Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 31st, 2005, 03:19 AM
peterthemackem peterthemackem is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 2 peterthemackem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 56 m
Reputation Power: 0
can anyone help! combo-boxes...

hi i am in the middle of trying to create a user interface with several drop-down combo boxes.
at the moment when the form is running they allow a user to enter whatever values they wish
but i want them to only be able to choose one of the values listed in the drop-down. can anyone
tell me how to acheive this please? i think its in the code but its a few years since i did vb and i
can't remember!

at the present moment there are 8 drop-downs and in all of them there the numbers 1 through 8.
i need to make them so that when a user selects, say value '1' from the first drop-down, it becomes
"unselectable" in the rest.

any help greatly appreciated,

I've got a major project to be handed in next friday.......!

Thanks, peter.

Reply With Quote
  #2  
Old March 31st, 2005, 09:15 AM
Darius Darius is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 108 Darius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 16 m 54 sec
Reputation Power: 5
I see 2 options:
1- To fill the other combo-boxes options from the event lost focus of the selected combo-box
2- To use a validate method to ensure that the value is a valid ones.

I take #1

Reply With Quote
  #3  
Old March 31st, 2005, 09:52 AM
peterthemackem peterthemackem is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 2 peterthemackem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 56 m
Reputation Power: 0
Quote:
Originally Posted by Darius
I see 2 options:
1- To fill the other combo-boxes options from the event lost focus of the selected combo-box
2- To use a validate method to ensure that the value is a valid ones.

I take #1


Darius,

i dont understand the first option it doesnt seem to make sense. the second one doesnt have much
to do with what im doing but thanks anyway. appreciate it.

iv discovered what i needed to do - the style property of the combo box has to be set to 2-dropdown list
and then it prevents user input and just allows selection.

Peter

Reply With Quote
  #4  
Old April 8th, 2005, 04:22 AM
proaos_cyrix proaos_cyrix is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 2 proaos_cyrix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 7 m 22 sec
Reputation Power: 0
Try this one this is the sample of coding you need:

In combo properties insert the list of # 1….8 then


In combo1(code view) type

If (combo1.Text =”1” ) Then

msgbox " Sample 1",vbOkOnly + vbExclamation,"Sample"

Else if (combo1.Text =”2” ) Then

msgbox " Sample 2",vbOkOnly + vbExclamation,"Sample"

Else if (combo1.Text =”3” ) Then

msgbox " Sample 3",vbOkOnly + vbExclamation,"Sample"

Until you meet the 8, then


Else
msgbox " Intruder",vbOkOnly,vbExclamation,"Invalid"
End if


Hope can Help you




IT Outsourcing Solutions
Offshore Outsourcing Solutions
Affordable Web Design
High Quality Adult Web Site Design
Ecommerce Web Site Design

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > can anyone help! combo-boxes...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT