|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
Quote:
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 |
|
#4
|
|||
|
|||
|
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 |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > can anyone help! combo-boxes... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|