|
-
Jul 16th, 2004, 02:12 AM
#1
Thread Starter
Hyperactive Member
Combobox clears itself
What the!...
First of all I tried to detect in Private Sub Combo1_Change()
the difference between Combo1.listindex = -1 and higher (selected in the dropdownbox), but it didn't work in VB.NET.
(In VBA it works perfectly!)
So I tried it differently:
I've made parallel to the change sub an 'click sub' to detect
the clicking in the dropbox.
If I fill my combobox and click in de dropdownbox,
then the combobox.text clears itself!
Does anyone know how to code the detection of changing the combobox through writing and change by selecting something in the dropbox?
Please help, I'v tried to much...
-
Jul 16th, 2004, 03:14 AM
#2
Member
UR problem is not corectly displayed
put ur code and ask ur problem
-
Jul 16th, 2004, 03:37 AM
#3
Member
Have you tried the "SelectedIndexChanged" Event?
I used this when I was programming with C#. Every times when you select the combobox, it fires this event.
Quitters never Win, Winners never Quit, But those who Never Win and Never Quit are Idiots 
-
Jul 16th, 2004, 03:48 AM
#4
Member
I don't know will it help....
Quitters never Win, Winners never Quit, But those who Never Win and Never Quit are Idiots 
-
Jul 16th, 2004, 03:53 AM
#5
Member
I don't know will this help. I searched from http://www.msdn.com
You can change the showSelectedButton_Click event into Combo1_SelectedIndexChanged event and try the following
VB Code:
Private Sub showSelectedButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim selectedIndex As Integer
selectedIndex = comboBox1.SelectedIndex
Dim selectedItem As Object
selectedItem = comboBox1.SelectedItem
MessageBox.Show("Selected Item Text: " & selectedItem.ToString() & Microsoft.VisualBasic.Constants.vbCrLf & _
"Index: " & selectedIndex.ToString())
End Sub
Quitters never Win, Winners never Quit, But those who Never Win and Never Quit are Idiots 
-
Jul 16th, 2004, 03:53 AM
#6
Thread Starter
Hyperactive Member
Thanks for the suply, I'll try if it works
Thanks, I'll try it!
(The code is to long to display. in short the problem occurs after the click function has ended. With F8 during the walkthrough everything looks normal en what's selected is displayed in de combobox, but with 'end sub' it's gone. But I will try SelectedIndexChanged)
-
Jul 16th, 2004, 01:02 PM
#7
You seem to be saying that this is a VB.Net problem so I've moved the thread to the VB.Net forum.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|