ComboBox Text Return

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

I am new to this so bear with me.

I have a set of combo boxes. Lets call them ComboBox1 and ComboBox2.

ComboBox1 items are pulled from a table. When a user selects a certain item
I want to disable ComboBox2. i can make this work in Visual Web Developer,
but have been unsuccessful in Visual Basic 2005.
 
Can you show it how you would do it in aspnet, maybe is that the best
traject to show it you in VBNet.

Did you know by the way that the most active VB newsgroup is

microsoft.public.dotnet.languages.vb

Cor
 
I can make it work in Visual Web Developer 2005 with the following syntax:

If DropDownBox1.SelectedItem.Text = "Normal" Then
DropDownBox6.Enabled = False
Else
DropDownBox6.Enabled = True
EndIF

I was hoping that the following would work in VB 2005 but so far I have been
unsuccessful in making it work.

If ComboBox.SelectedItem.Text = "Normal" but there is no Text child object
for Selected Item.
 
DJ,

In my idea is the currenttext in a combobox is always the selectedtext.
Combobox1.text = normal

What do I miss?

Cor
 
Correct me if I am wrong but ComboBox1.Text = "Normal" would set the text in
the box to Normal.

What I am trying to do is return the text value of whatever item is selected
so that when one imparticular item (Normal) is selected, ComboBox6 will be
disabled.
 
DJ,

I mean

If Combobox1.Text ="Normal" then instead of your code

If DropDownBox1.SelectedItem.Text = "Normal" Then

Cor
 
DJ,

Yes show the code that you are curently using to set the binding to the
datasource, it seems you have something very special.

Cor
 
I am using Microsoft Visual Basic 2005 Express Edition. I selected the
ComboBox and checked "Use Data Bound Items". Data Source is set to the SQL
Table. I believe the underlying code is
NewProjectDataSet.Morph.Fill,GetData()
 
Hello news.microsoft.com,

Set a breakpoint on your Combobox1.SelectedIndexChanged event. Then set
a watch on Combobox1 and Combobox1.SelectedItem.

The watch window will tell you all you need to know.

-Boo
 
I set a breakpoint at the SelectedIndexChanged event and the text visualizer
for the Combobox.Selected Item just displays "" for any item that is
selected.
 
Back
Top