AllExperts > Experts 
Search      

Visual Basic

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Visual Basic Answers
Question Library

Ask a question about Visual Basic
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Ravindra
Expertise
visual basic application programming from design to access information, sql, engineering and commercial applications. access databases, excel. Optional: 1)a large number of people want me to do work which takes some time and effort. Pl.note that i would like to be paid for such work. 2) if you want me to spend quality time and do special work, i expect to be paid a reasonable price for my time. 3) if you are pleased with my reply you could consider a donation of 1$. 4) you can visit my website http://ravindra.coolpage.biz (under constrn)

Experience

Past/Present clients
project work for a Norway company, and a Canadian company completed. Freelance Project work and Teaching
teaching vb

 
   

You are here:  Experts > Computing/Technology > Basic > Visual Basic > Combo box in VB

Topic: Visual Basic



Expert: Ravindra
Date: 6/20/2008
Subject: Combo box in VB

Question
Dear Sir,

i wnat to ask a question ?

My question is :

i m making a project in vb. in this project i place a combo box. now i want to lock this so nobody can write in this.so i used its locked property and set it to true but now i cant excess the combo box. sir i just want to prevent users that they can not write anything in this and only select index in this(like RED, BLUE, YELLOW, GREEN etc.). but locked property fully locked him.

Please help me on this topic

regards
Amit singla

Answer
put your values red,blue etc in Combo1 list property

and have combo1.enabled=false
have a commandbutton or an UPDOWN control next to the combo with this code

Option Explicit
Private Sub Form_Load()
Combo1.ListIndex = 0
End Sub

Private Sub UpDown1_DownClick()
Static adu1 As Integer
adu1 = Combo1.ListIndex
adu1 = adu1 - 1
If adu1 = -1 Then Exit Sub
Combo1.ListIndex = adu1
End Sub

Private Sub UpDown1_UpClick()
Static adu As Integer
adu = Combo1.ListIndex
adu = adu + 1
If adu = Combo1.ListCount Then Exit Sub
Combo1.ListIndex = adu
End Sub
then no one can enter the values into the combo

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.