Jump to content
Xtreme .Net Talk

CanOz

Members
  • Posts

    7
  • Joined

  • Last visited

CanOz's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi bshaen Odd, that should not happen. Which Event are your calling the InputBox from? If you could post up the whole code for the Event it would help.
  2. I was afraid of that. I really don't like the idea that I must write extra code to do this silly little thing that should be handled with one line of code. Right now I am using a Hidden TextBox to cover the ComboBox if the Items match, but it just does not look quite right. That could just be me being VERY picky though. Thanks for your help and suggestions.
  3. Hi Never a waste of time to ask. The ComboBoxes are set to DropDown and the Text is not in the List of Items. For some reason, I seem to be unable to set the Text Property of the ComboBox using the SelectedIndexChanged Event of the ComboBox. I can change the Text Property of other Controls, just not the one that the event is for. I am probably being overly fussy with this as the User would not be able to continue until the condition of having different items selected is met, but I like to prompt my users just that little bit more.
  4. A good beginners look at reading and writing files can be found here: http://www.vbcity.com/forums/faq.asp?fid=41&cat=SystemTID97238
  5. Hi Harold Instead of setting the TextBox to Disabled, set it to ReadOnly, then you can set the BackColor of the TextBox to White and the ForeColor to Black and it will look like a "Normal" TextBox.
  6. What I want to do is fairly simple. (or so I thought.) I have 2 ComboBoxes on my Form each populated with the same data. I want to check when the user Selects an item in the second ComboBox and see if it is the same as the item they selected in the first ComboBox. If they are different then they can proceed, however if they are the same then they must choose a different item in the second ComboBox. Here is a generic version of the code I am using in the SelectedIndexChanged Event of the second ComboBox. If ComboBox2.Text = "Select a Colour" Then Exit Sub End If If ComboBox2.Text = ComboBox1.Text Then If MessageBox.Show("You must select a different Colour", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error) = DialogResult.OK Then ComboBox2.Text = "Select a Colour" Exit Sub End If ' code here if the two selected items do not match Now the hitch. The Text in the second ComboBox does not change to what I want, it actually reverts back to the Text of the Item selected. Can anyone tell me how to go about setting the Text of a ComboBox?
×
×
  • Create New...