.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

how to block user written text in combobox while executing the program

Posted By:      Posted Date: October 16, 2010    Points: 0   Category :WPF

'i have written the following code:



Sub Combo_Mth_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)

View Complete Post

More Related Resource Links

ActiveX and Visual Basic: Enhance the Display of Long Text Strings in a Combobox or Listbox


The combobox and listbox controls in Visual Basic have no built-in support for displaying text strings that are too long to fit in the visible area of either control. This article describes several techniques to improve the readability of long strings in each control. The first technique uses tooltips to display a combobox or listbox item. The other techniques, which use various Windows APIs, include adding a horizontal scrollbar for a listbox and determining the necessary width of the longest string given the font attributes of the text. The required steps are described for both comboboxes and listboxes.

John Calvert

MSDN Magazine December 2000

ComboBox text/value selection?


When we select a value from combobox list, we can get it by combobox.selectedvalue.text, however when we enter a new value in combobox, we can get it by combobox.text when submitting a form.  During submission, how will we handle this situation? Either there is a single way of getting value in both situations or we'll have to tackle both situations separately?

Please help me tackling this situation. Thanks

TextBox shows binding source text when window load, so why not with the ComboBox?

How can I get a ComboBox to show the binding source value when my window opens?  I have been searching all day for a solution to this, but cannot find anything.  So I have created a sample project to demonstrate my problem.  Below is a Vehicle class, very simple, two members Category and Make.  Category is an enumeration, Make is a string. namespace ComboExample { public class Vehicle { // Constants and enumerations public enum eCategory { Road, Air, Sea } // Attributes public eCategory Category { get; set; } public String Make { get; set; } // Construction public Vehicle(eCategory Category, String strMake) { this.Category = Category; this.Make = strMake; } } } Here is the C# for the MainWindow.  A new Vehicle object is created as a member.  In the constructor I set a data-provider in the XAML to this Vehicle object.  There is a button event for showing the values of the controls and objects so I can check the binding. namespace ComboExample { // Interaction logic for MainWindow.xaml public partial class MainWindow : Window { // Attributes Vehicle m_Car = new Vehicle(Vehicle.eCategory.Road, "BMW"); // Construction public MainWindow() { InitializeComponent(); // link data-p

Retrieving a number from a comboBox value including number and text

Hi, I am using C# and trying to retrieve a number from a value in a comboBox that contains both numbers and text.  I am modifying what is in the comboBox using the following format which is working fine ("130mm Corus-Comflor 46" is a value already loaded into the comboBox):   this .floorComboBox.Text = "130mm Corus-Comflor 46" ;   This line of code is changing what is in the comboBox and from what is written in the combo box, I would like to be able to retrieve just the first number '130' from the newly updated comboBox so that I can use it elsewhere.  I am not sure how to go about this and I have looked online for something similar, but with no luck. Best regards, Mike  

Getting user input from a ComboBox

What is the most reliable way to get the current user input from a ComboBox? I've noticed that SelectedItem.Text, SelectedValue, and Text all contain the wrong result when the user deletes everything in the box and then immediately does something to cause a postback without clicking outside the box first (e.g. the user presses Backspace to delete the current contents and then presses a Submit button without clicking on anything else in the form first).

How to make a yes/no ComboBox user control

How to make a yes/no ComboBox user control

Tab Panel inside a User control - null referance to text box with set properties

Hi guys, Im having problems with the following: I have a user control which has a tabbed panel inside, I then have a public property which populates a textbox inside the tabbed panel, HOWEVER when I access the property on my ASPX page, it give me a null referance to textbox, I have tried using findControl but still finds nothing, Please help!! ASPX PAGE  <Registration:UserDetails UserID="23" ID="RegistrationUserDetails" runat="server" /> USER CONTROL<cc1:TabContainer ID="TabContainerRegistration" runat="server" ActiveTabIndex="1" > <cc1:TabPanel runat="server" ID="TabPanelAccessDetails" HeaderText="Access details"> <ContentTemplate> <table> <tr> <td>User ID</td> </tr> <tr> <td><asp:TextBox ID="UserIDTextBox" ReadOnly="true" runat="server" SkinID="InputBoxes"></asp:TextBox></td> </tr> </table> </ContentTemplate> </cc1:TabPanel> </cc1:TabContainer> CODE BEHINDprivate int _UserID; public int UserID { set { TextBox tb = (TextBox)TabContainerRegistration.

Making the program make text boxes according to a num of a variabe

i have a text abox that the user need to enter a number then according to this number the program need to show text boxes

Wish to stop user from entering text in a textbox

I want to stop user from entering stuff in a textbox. But if I use Readonly then for some reason I can't get the information to the database. Ant ideas? 

Executing a program on a remote computer


I'm trying to execute a program on a remote computer, using code ofcourse, and i'm trying the following:

The function rerturns code 8 which says "unknows failure" and the program i was trying to execute (or any other program for that matter) doe's not run.
Nothing happens except that on the remote computer the mouse curser changes for a split of a second. I know the connection is OK because of that - plus if i change one of the parameters (computer name, user name, password) to a wrong one, the program exits.

Does anyone know what might be the problem?


highlighting the text of the selected item in Ajax Combobox


Is there a way to programmatically select the entire string of the selected item in the AJAX Combobox?

What I'm trying to do is bascially on a State/City selection.

1.  User selects a State from the first combobox.  This triggers the City combobox to be populated.  The item(0) is "Select One:".

2.  I want the entire "Select One:" to be hightlight as if the user had used their mouse and highlighted all the text.

The reason for this that I'd like the user to be able to start typing the city without needing to clear out the "Select One:" manually.

Can this be done?

How to save a multiple user control to a few single record text?

I have a list with people pecker control that admits multiple users.
I like to have another list with one record for each user in the control that loaded before.
Is there any way in InfoPath or in a workflow to use something like FOR EACH to take one by one user in a control and write/update records after that?
Thank in advance

change the forecolor of a text block inside a listView


Hello I'm new to WPF

I have a list view as follows:




<ListView Name

Executing SharePoint console application without sharing user credentials


I have a console application, which uses SharePoint object model to do some business operation, therefore it has been deployed on SharePoint server. Without sharing username/pwd, earlier we allow several users to access this console application by providing remote desktop file (.rdp) file. This .rdp file (ver5.1) contains username and encrypted password. With recent version 6.0 of .rdp, it still prompts for password. You may argue that it is due to security constraint.

What is the best approach to allow more users to run this console application without sharing user credentials, without modifying the console application.

Thanks in advance


J Justin


In a button's control template, how can I alter the color of a text block?


Using WPF 4, I'm trying to create a button style (that would preferably work in SL, as well) that alters the text color of any contained text when the button is mouseover'd. Since I'm trying to make this compatible with Silverlight, I'm using the visual state manager:

<Style TargetType="{x:Type Button}">
  <Setter Property="Template">
      <ControlTemplate TargetType="Button">
        <Border x:Name="outerBorder" CornerRadius="4" BorderThickness="1" BorderBrush="#FF757679">
            <VisualStateGroup x:Name="CommonStates">
              <VisualState x:Name="Normal" />
              <VisualState x:Name="MouseOver">
                  <ColorAnimation Duration="0" To="#FFFEFEFE"

block dba access to user data


Is there a way in sql 2008 to block a dba's access to user data? I think the capability exists. however I cant seem to find any documentation on it.




how to check avaibility for user name as soon as text box lose his focus


hi friends,

i am developing web portal and i need to know, how do check user name is available or not in database as soon as textbox lose focus,

i have problem, how to go code behind page after textbox lose his focus.

thanx in advance. 

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend