Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 9th, 2005, 4:22 AM   #1
cloud-
Hobbyist Programmer
 
Join Date: Jan 2005
Posts: 110
Rep Power: 4 cloud- is on a distinguished road
hey im new to the forum and vb aswell

i have a combo box
but how do i get the text from it
i tried

if (combo1.seltext = "bla") then
bla

but it didnt work

and i tried combo1.text and that did not work either
?

what am i doing wrong

thanks
cloud- is offline   Reply With Quote
Old Jan 9th, 2005, 7:42 AM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Combo1.Text should work....
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Jan 9th, 2005, 12:27 PM   #3
cloud-
Hobbyist Programmer
 
Join Date: Jan 2005
Posts: 110
Rep Power: 4 cloud- is on a distinguished road
must be me doing something wrong then
could you please tell me what it is

Private Sub Combo1_Click()

If (Combo1.Text = dark) Then
Text1.Text = dark
ElseIf (Combo1.Text = Light) Then
text1.text = light
End If

End Sub

ive got no idea ?_?

thanks
cloud- is offline   Reply With Quote
Old Jan 9th, 2005, 3:01 PM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
You need quotes around the buggers:
 If (Combo1.Text = "dark") Then
  Text1.Text = "dark"
ElseIf (Combo1.Text = "light") Then
  Text1.Text = "light"
End If
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Jan 9th, 2005, 3:20 PM   #5
cloud-
Hobbyist Programmer
 
Join Date: Jan 2005
Posts: 110
Rep Power: 4 cloud- is on a distinguished road
thanks alot for your help

still wont seem to work though >_<

maybe its because its the wrong event but i tried click and change and nothing also i changed the type of the combo so that it can not be edited i think thats why i cant get the .text property to work because its like a normal list box selection (which i dont know how to get the text from either)

any ideas

thanks alot
cloud- is offline   Reply With Quote
Old Jan 9th, 2005, 4:21 PM   #6
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Make sure they're in the correct case as well.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Jan 9th, 2005, 5:21 PM   #7
cloud-
Hobbyist Programmer
 
Join Date: Jan 2005
Posts: 110
Rep Power: 4 cloud- is on a distinguished road
lol


yep they had a capital on the first letter, i didnt think that would matter

thanks alot
cloud- is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:21 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC