Current location: Hot Scripts Forums » Programming Languages » Visual Basic » Weird issue with combobox


Weird issue with combobox

Reply
  #1 (permalink)  
Old 03-20-05, 01:32 PM
glgl123 glgl123 is offline
New Member
 
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Weird issue with combobox

Hello,
I got some weird issue with combobox
Code :
Private Sub Combo1_Click()
dim d
d=0
d = d + 1
If d = 1 Then
If Combo1.Text = "please enter something" Then
Combo1.Text = ""
End If
End If
End Sub

When I click on the combo box,The text won't change
Same code on KeyPress-Works just fine

What's wrong?

Thanks in advance!
Reply With Quote
  #2 (permalink)  
Old 03-25-05, 06:06 PM
Keithuk's Avatar
Keithuk Keithuk is offline
Newbie Coder
 
Join Date: Sep 2004
Location: Staffordshire, England
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
You need to put this in the Combo1_Change event.

Private Sub Combo1_Change()

Dim d As Integer

d = 0
d = d + 1
If d = 1 Then
If Combo1.Text = "please enter something" Then
Combo1.Text = ""
End If
End If

End Sub
__________________
I've been programming with VB for 13 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

http://www.martin2k.co.uk/forums/

Last edited by Keithuk; 03-25-05 at 06:14 PM.
Reply With Quote
Reply

Bookmarks


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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
One ComboBox with two field's mangeshdeshmane Visual Basic 2 12-02-05 10:21 PM
ComboBox Terix Windows .NET Programming 3 03-31-05 08:00 PM
Perl Programmer sought for small issue usallsys Job Offers & Assistance 0 03-04-05 07:09 AM
Weird behaviour with sessions Skeleton Man PHP 1 10-27-04 09:42 PM
Problem with date in combobox. Periodically lose valu Danie Visual Basic 1 03-04-04 02:41 PM


All times are GMT -5. The time now is 01:14 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.