|
-
May 17th, 2013, 01:11 PM
#1
Thread Starter
Banned
[RESOLVED] listbox click
when i hover over an item in list1 and click it , its clicked once but then right after i clicked it how do i make it click auto just once on that same item ? please urgent
-
May 17th, 2013, 01:18 PM
#2
Re: listbox click
 Originally Posted by ladoo
... how do i make it click auto just once on that same item ?
Can you explain it better?
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
May 17th, 2013, 01:25 PM
#3
Thread Starter
Banned
Re: listbox click
when i single click on any item in list1 it counts as 1 click , right after i clicked it with mouse how do i get the programme to click that same item just once again
-
May 17th, 2013, 01:30 PM
#4
Thread Starter
Banned
Re: listbox click
i tried
Code:
Dim J As Integer, ii As Integer
For J = List1.ListCount - 1 To 0 Step -1
If InStr(List1.Text, "@yahoo.com") Then
Else
Text2.Text = "@yahoo.com"
List1.Selected(0) = True
End If
If InStr(List1.Text, "@ort.nl.rogers.com") Then
Text2.Text = ""
Else
End If
If InStr(List1.Text, "@rogers.com") Then
Text2.Text = ""
Else
End If
If InStr(List1.Text, "@xtra.co.nz") Then
Text2.Text = ""
Else
End If
If InStr(List1.Text, "@att.net") Then
Text2.Text = ""
Else
End If
If InStr(List1.Text, "@rocketmail.com") Then
Text2.Text = ""
Else
End If
If InStr(List1.Text, "@ymail.com") Then
Text2.Text = ""
Else
End If
If InStr(List1.Text, "@yahoo.cn") Then
Text2.Text = ""
Else
End If
If InStr(List1.Text, "@kimo.com") Then
Text2.Text = ""
Else
End If
If InStr(List1.Text, "@talk21.com") Then
Text2.Text = ""
Else
End If
If InStr(List1.Text, "@btinternet.com") Then
Text2.Text = ""
Else
End If
Exit For
DoEvents
Next J
when i click it , it goes to top of the list always
list1 items
demo1
demo2
demo3
demo4
say i clicked on demo2 once , how do i get programme to click on that just once more
-
May 17th, 2013, 02:03 PM
#5
Re: listbox click
Why did you put in all those empty else statements?
Why do you have an exit for at the bottom of the loop? You do know that it will not loop with this in there right?
Also the doevents will never execute as you are jumping out of the loop on the line before it
Why do you want the program to click you list item again after it is clicked the first time?
You will get better results if you describe what you are trying to accomplish rather than how you are trying to do it.
So what is the actual goal here? It would seem that making the click event fire again is not a good idea and there is probably a better way to do whatever it is you are trying to do.
-
May 17th, 2013, 02:26 PM
#6
Thread Starter
Banned
-
May 17th, 2013, 02:38 PM
#7
Re: listbox click
Try:
Code:
Private Sub List1_Click()
Dim i As Integer
Static bClicking As Boolean
If Not bClicking Then
bClicking = True
i = List1.ListIndex
List1.Selected(i) = False
List1.Selected(i) = True
bClicking = False
End If
End Sub
Last edited by Bonnie West; May 18th, 2013 at 06:51 AM.
Reason: Modified code
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
May 18th, 2013, 01:42 PM
#8
Thread Starter
Banned
Re: listbox click
thanks allot bonnie working em hugz
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|