Detecting The Mouse Click Event With A Combo Box Control
Does anyone know if there is a mouse click event fired when a combo box dropdown is clicked. The click event seems to fire only when something is selected from the dropdowm list. But if nothing is selected the event appears not to happen.
I need a way to detect the click event even if nothing is selected or no changes are made to the selection.
Can anyone help?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Image Control Mouse Click Event?
HIiiii
I am trying to use Image Control MouseDown and MouseUp event. It is responding for right mouse click. But not for left mouse click. Even it is not responding for Click and Double_Click event too.
What could be problem?
Hdave
Detecting Mouse Click
Im writing an activex control. I need be able to detect whether the mouse has clicked or not. Now I know that half of you are itching to type a post that says to write it in the click and mousedown events. But I need to be able to detect wheter the mous has clicked anywhere(Another form, desktop, doesnt matter).
THANKYOU :-)
Jason
Detecting Mouse Click Anywhere
how could i find out if right mouse button was pressed outside the form. Anywhere in windows, during a game or at any time ?
!Help On Detecting Mouse Click's!
Hi I was wondering what API would be used to detect Mouse click's like I want it to give me a message box if the left or right buttons clicked. And I want it to work off my forms window. What I need this for is remote desktop that I’m creating but I can’t seem to find the API I need in an API Program that I got from AllApi website.
I Have Api2004 for the constants and types. I’m working with visual basic's 6 studio and no MSDN. So what could i use to detect mouse left and right clicks??
P.S Thanks for your time and hope you could answer my question
Mouse Up Event Misfired In The Righ Click Event Of The Flexgrid! Help Needed
Hai,
When the user right click the first column of the MSHFlexgrid then a PopUpMenu rises, for that i coded as below. But when the user click the row header which i used to display the Serial No. there also the popupmenu rises. how to avoid this. I am using the below code to identify the First column of the grid and rise the popupmenu.
so i am getting problem. because when the user click a item in the popupmenu then i the next form is show with the value of the MshFlexgrid FirstColumns text..
Private Sub MSHFlexGrid1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbRightButton And MSHFlexGrid1.MouseCol = 1 Then
Me.PopupMenu mnuReport
End If
End Sub
How to solve this problm. Kindly suggest your idea.
Thank you very much,
Chock.
itchocks@rediffmail.com
<HTML>
<B><font color="#008000">HAVE A NICE DAY !</font></B>
<HTML>
Detecting Mouse Click Anywhere In Program
i'm writing a program in which i would like to detect a mouse click anywhere within the program, whether it's on the titlebar, the menubar, or anywhere within the form. The program auto-minimizes after 10 seconds, but i'd like it to not do this if the user clicks anywhere.
is there an API function or somtehing to detect a mouseclick anywhere within an application? or any other solutions?
any help would be appreciated.
thanks!
Detecting As Mouse Click On A Text Box
Ok, here's what I'm trying to do.
How do I make the program capture the mouseclick details on the controls on a form?
For example, when the user clicks the mouse, I want the details of the control that was clicked, such as the Caption, Tag and so on.
please help!!
thanks!
nigel
posted this on the API forum, but no one answered
Detecting Titlebar Click Event
Please could anyone help, Im trying to detect a click event in the title bar, I have looked at a few suguestions but im very confused they dont seem to do what i want. Im not using mdi forms, i just want to detect an click, mouse down etc events.
Detecting Click & Hold Event
I want to be able to tell if the user holds the mouse button down on a command button used to scroll through recordset records, and if so, start scrolling automatically in the direction indicated.
Raising A Mouse Click Event Without Clicking On The Mouse
I want to raise a mouse click event on a form in a project from another
project without actually clicking on the command button..
For eg:
I have an application which has a sign in form where i accept username
and password... There is a sign in command button..
I want to try and sign in from another project without actually
clicking on the sign in button...
i.e I want to call the commandbutton_Click( ) function of that command
button
I know there is something like "reflection" in C# (VB.NET) but i want
to do this in Visual Basic 6.0...
Losing Focus And Detecting Mouse Click
Two questions:
1) Under what circumstances does the LostFocus event occur on a form. I want to execute some code as soon as another application is made active but the LostFocus event doesn't seem to do this. In other words, I would like to execute some code as soon as another application becomes active. For example, if I was in my program and suddenly switched over to Notepad, I want to execute some code. How to do it?
2) This one a little more complicated. How can I set up a loop within my program that is only executed when the user clicks the mouse button?
Thanks,
Ryan Small
Mouse Click Event
1.) I can't seem to find code for the mouse click event for anywhere that a user clicks on a form, including textboxes, listboxes, and buttons. I am trying to code for a log out method for my pos program. If a user clicks anywhere on the form, I will have a timer to go on, and after 2 minutes, if the position is still the same, the pos will log out to the original log in screen. This will help to prevent other users from getting on another user's account that has been left on. I don't need any other code except that of how to detect what position the mouse is at after it is clicked anywhere on the screen.
2.) The code will have to detect for any form other than the main screen, so I'm guessing some type of global code here. Would I have a way of just putting the code into a module and referencing it instead of copying the code for every form?
Much Appreciated,
Zack
Mouse Click Event
I have an application which includes a frame on which is placed a number of command buttons. When a button on the main form is pressed the frame becomes visible and when a button on the frame is pressed the frame becomes invisible.
What I am looking for is a way of detecting a mouse click on any other part of the main form (or one of its components) while the frame is visible to indicate that the frame is no longer required and will then become invisible. I need this frame to function similar to a pull down menu which will disappear if you click on any other object, but will activate the selected fuction if that is pressed.
Simulate A Mouse Click Event
Hello, is it possible that when i press a button it reactes the same as i would have clicked with my mouse on it? I tried MouseDown, things like that but i guess its a little bit harder than that.
Capture A Mouse Click Event
I have a login form with two fields, UserID and Password (duh !!)
It also has two controls, OK and CANCEL.
I also have a routine in the code that calls a message box routine if the UserID loses focus that activates if there is no UserID is entered (UserID="").
Is there a way to capture the mouse click on the CANCEL control that will set a flag or some other way bypass the LostFocus routine?
Thank you,
Jenn
How Can I Get Left Click Event Of Mouse?
HI All!
In my application i have to have all the three events of a mouse.... like left click, right click and the middle button(scroll) click events.
I already wrote the event mouses's down event. in that event i am able to get the middle button(scroll)'s event and right click event, but i am unable to get the left button's click event....
How can i get this Leftclik event of mouse? here is my sample code...
Private Sub Image1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 4 Then
boolDragDrop = True
End If
If Button = 2 Then
Delete.Tag = Index
Me.PopupMenu RClick
End If
If Button = 1 Then 'this is not working..... how can i get this ?
MsgBox ("
yes...it is button1")
End If
End Sub
Please let me know... if u know this..
Thanks in advance:
regards:
raghunadhs.v
Mouse Co-ordinates On Click Event
How do I get the Mouse Pointer Coordinates on the _Click event? I know I can get them using the _MouseDown Event, but I need them on the _Click event.
Mouse Click Event Coding
I remember seeing some code on vb-world.net a while back on how to make the system right click or left click and also how to make them double click. I searched and i can't find it anymore on the web at all. Can someone link me to somewhere or can someone just make a bas file and send me a copy of it to my email address? i really need this for some program i am working on. Thanks, i need this asap...
im trying to make a program that will move the mouse around to certain areas of the screen and then click or double click on that spot. So i need the code for the system to right/left to click/double click
thats what i need...can you help?
<BantyRan@optonline.net>
Failure Of Mouse Click Event
I am working on a project that depends on obtaining real-time data from a web site. When I go to this web site, I must first log in. I am then at a page where I must choose (by mouse click) one of three options. This choice takes me to a page where again I have numerous choices to make before arriving at the page which contains the data I want. I am attempting to obtain this data programmatically rather than visually.
My approach to the project follows. The project is still in design mode so I have broken it into several steps which I will later combine. I have at this point a form containing a web browser, two command buttons and a text box. When I start the project the web browser navigates to the desired web page. Since I must log in and since the log in text boxes are not visible on my browser I click the click the first command button which is captioned “Log In”. The click event code uses the mouse event API to first move the cursor to the down arrow of the web browser scroll bar, and then click the required number of times (predetermined) to bring the log in textbox into view. The cursor then moves and clicks to bring focus to the textbox. The keyboard event API is then used to enter my personal data, after which the browser navigates to the next page. At the present state of development of the project I now manually choose between the 3 options bringing up the page with numerous choices. I now click the 2nd command button which is captioned “Get Active Choices”. This click event first gets the HTML behind this page by using the command: WebBrowser1.Document.body.innerHTML. By studying the patterns of this HTML I am able to see the pattern when choices are active and by previous visual inspection of the page I have programmed the number of clicks on the scrollbar and the location of where to click on the page in order to bring up the page where the data I want is. When I have this page I can get the desired data by the method of decoding the HTML.
After this detailed description we come to the problem. After I click on the “Get Active Choices” command button, the cursor does move to the scroll bar location but it either does not click, or the scroll bar does react to the click. Consequently when the cursor moves over (and clicks – maybe) the predetermined position on the browser page it is not over and clicking on the embedded button --- it does not navigate to the right page and I don’t get my data. I emphasize that the first time I used this process by clicking on the “Log In” button it works fine –the scroll bar moves down and I can see the page move down.
This is added as perhaps a clue. In an attempt to solve the problem on my own (an attempt now over 12 hours long) I added a third button to the form with the code shown below. When I click on this button the scroll bar does move down – that is , it works!!!! If I put a stop at end sub it does not work although all of the code occurs before the stop. Can it see the future?? Thanks in advance
Code:Private Sub Command3_Click()
Const MOUSEEVENTF_MOVE = &H1
Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_ABSOLUTE = &H8000
XPosition = 1460 * 65535 / 1600
YPosition = 842 * 65535 / 1200
'move mouse to down arrow position
mouse_event MOUSEEVENTF_MOVE Or MOUSEEVENTF_ABSOLUTE, XPosition, YPosition, 0, 0
'click mouse 12 times
For m = 1 To 12
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_ABSOLUTE, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP Or MOUSEEVENTF_ABSOLUTE, 0, 0, 0, 0
Next m
End Sub
Code: [/code]
Mouse Event Click <solved>
Hey, i was wondering how i could simulate a mouse click at a certain location on the screen. If anyone has any ideas on how to do this please respond.
Thanks,
Crazy
Edited by - crazyoldman on 1/14/2006 5:03:32 PM
How Do I Disable The Mouse Click Event.
Hello.
On my form I have a Frame containing 6 Textbox's and I need to stop the user from clicking on these Textbox's with the Left mouse button but I still need the user to be able to Tab from one box to the next. On the forum I have seen 2 API's that claim to disable the mouse click but I cannot get either one to work.
If anyone can help I would be most gratefull.
Thanks.
SKM
Button Mouse Click Event
Hi,
Can two Forms (Form1 & Form2 with Command1 & Command2 BUTTONS on each Form) be set to display (visible) at same time, & to enable EITHER of the two buttons be clicked thus firing Command1_Click () / Command2_Click () ?? Or must one be set to have the focus? Doesnt moving the mouse over the buttons & clicking the mouse automatically gives the button covered the focus?
Also, is there corresponding Registry ACTIVEX API functions to the Webbrowser Control Events module, ie without using Webbrowser Event Control package?
Please provide brief sample codes if possible.
Left Mouse Click Event
How can I make the click event code of a label execute only to a left mouse click? And I dont want to put the code in the mouse up and mouse down events.
Capturing Mouse Click Event
HI,
On my VB form, i have a command button for which i want that whenever it is clicked, i should call a module. How do i do that?
Right Click Mouse Event Into A List View
Hi,
i am new to VB and need ur help.
i need to implement right click mouse event into a list view. how can this be done??
Info on any sites that explain these with simple code examples will also be helpful.
Thanks in advance.
Why Mouse_Move Returns Mouse Click Event?
Hi,
I believe you all know how to put the application to the system tray (use Shell_NotifyIconA). What I want to ask you is why we can use the X coordinate in the Mouse_Move event to determin double click?
Thank you in advance.
Need An API Function To Repeat Mouse Click Event.
Hello everybody
I'm searching for a solution to repeat mouse click event. It sounds stupid but I really nead it. My purpose is when user click mouse, it will switch to dblclick event automaticlly.
I think SendMessage API function can do it, but I don't know how to use it in detail. Anyone can help me?
Thanks for any suggestions.
Trung
Combo Box Click Event
Hi,
I have a form that contains 2 combo boxes. At the click of either combo boxes, the values from the database should be loaded accordingly.
However, I found that at the point of form_load event, loading the values of the combo boxes trigger the combobox_click event. Hence, when loading the 2nd combo box, it will trigger an error which says "text is read only property"
Code:
Private Sub Form_Load()
Set objServer = New clsServer
ClearAllFields
Set tbsOptions.SelectedItem = tbsOptions.Tabs(1)
Set rs = objServer.RetrieveRec()
With comboPassportID
.List(0) = defCboStr
.Text = .List(0)
Do Until rs.EOF 'this triggers the click event in comboPassportID
.AddItem rs("passport_id")
rs.MoveNext
Loop
End With
Set rs = objServer.RetrieveRec()
With comboFirstName
.List(0) = defCboStr
.Text = .List(0)
Do Until rs.EOF 'this triggers the click event in comboFirstName
.AddItem rs("first_name")
rs.MoveNext
Loop
End With
End Sub
Private Sub comboPassportID_Click()
Dim str As String
If comboPassportID.Text = "Select One" Then
Exit Sub
Else
Set rs = objServer.RetrieveRec(comboPassportID.Text)
comboFirstName.Text = rs("first_name")
comboLastName.Text = rs("last_name")
str = rs("ctry_code")
comboNationality.Text = objServer.ReturnValue("Country", str)
txtAddress.Text = TrapNull(rs("addr"))
txtCity.Text = TrapNull(rs("cty"))
txtState.Text = TrapNull(rs("stt"))
txtZipCode.Text = TrapNull(rs("zip"))
txtContactNo.Text = rs("cnt_num")
txtMobileNo.Text = TrapNull(rs("mbl_num"))
txtFaxNo.Text = TrapNull(rs("fax_num"))
txtEmail.Text = TrapNull(rs("eml"))
txtCompanyName.Text = TrapNull(rs("org_name"))
txtFlightNo.Text = TrapNull(rs("flt_num"))
Set rs = Nothing
End If
End Sub
Private Sub comboFirstName_Click()
If comboFirstName.Text <> "Select One" Then
Exit Sub
Else
comboLastName.Clear
Set rs = objServer.RetrieveRec(comboFirstName.Text)
With comboLastName
.List(0) = defCboStr
' .ListIndex = 0
.Text = .List(0)
Do Until rs.EOF
.AddItem rs("last_name")
rs.MoveNext
Loop
End With
Set rs = Nothing
End If
End Sub
Is there any way in which I can maybe detect a form_load event and prevent the click event of the combo boxes being triggered?
Thanks.
fAntAsy.
Combo Click Event
Hi,
This code is initally put under my combo click event, is there anywhere else I can place this code other than click event. This code is to check the status of the car when user click on the combo key.
VB Code:
If Cbo_Reg.Text <> "Select Car Reg No" Then sql = "SELECT DISTINCT * FROM CarDetails WHERE CarRegNo='" & Cbo_Reg.Text & "'" rs.Open sql, cn, adOpenStatic, adLockOptimistic, adCmdText If rs("Status") = "Available" Then 'Rent car to customer ElseIf rs("Status") = "On Rent" Then Cancel = True MsgBox "Car is on rent now" & vbCrLf & "Please reselect a Car Reg no", vbCritical, "Invaild Selection" ElseIf rs("Status") = "On Reservation" Then Cancel = True MsgBox "Car is on Reservation now" & vbCrLf & "Please reselect a Car Reg no", vbCritical, "Invaild Selection" End If
Combo Box Click Event.
Ok if I do:
VB Code:
Private Sub ChangeIndex(ByVal plngIndex As Long) cboUsers.ListIndex = plngIndexEnd Sub
Then the Click event fires...except if the plngIndex = -1...
And yes, I know I can do:
VB Code:
Private Sub ChangeIndex(ByVal plngIndex As Long) cboUsers.ListIndex = plngIndex If plngIndex = -1 Then Call cboUsers_Click() End IfEnd Sub
But that is crappy code
And NO, I am not subclassing it
Woka
Combo Box Click Event
Can anyone tell me if it is possible to disable the click event that is generated when you change the ListIndex property of a combo box ?
Combo Box Click Event
Hello Friends,
I've dept_mst and two fields dept_cd,dept_name.
Also i've emp. master table in which deptcd is my foreign
key related to dept_mst.I've placed combo box on emp. master form
and retrieve the records of dept_mst only dept_cd,and i've placed
one textbox to retrieve the deptname after selecting the one of
the deptcd in combo box list.After selecting the deptcd from list
the textbox should display the corresponding dept_name from
dept_mst table.
Please suggest the code how will it be.Thanks in advance.
Regards,
Prashant.
Combo Box Click Event
How can I control the generation of click event of combo box when I load the form.
I have two combo boxes and I have a sub-routine which I want to get executed from the click events of both the combo boxes.but I want the click event to be fired for only first combo box for the first time when form is loaded.
In form.activate event i have written
combo1.listindex=0
combo2.listindex=0
Any help!!!
Thanks in advance
Combo Box Click Event
If I'm not wrong, combo box click event must only triggered when the user
clicks on the combo box. But something unsual is happening with my code.
combo box click:
Private Sub cboTrack_Click()
'do something here
End Sub
Private Sub Example()
cboTrack.Text = cboTrack.List(0) '<========= 'I have a breakpoint
here
End Example
Whenever the control is done with;
cboTrack.Text = cboTrack.List(0) '<========= 'I have a breakpoint
here
it goes to combo box click event. But i haven't called it and have no
intension of doing it either.
Is there a way to stop VB to go to combo box click event ofcourse without
deleting the event itself?
Thanks,
Simon
Capture Mouse Event On Combo Box.
Hello,
Does anyone know how to capture mouse events on combo boxes. I would like to know when the left mouse button is clicked on an item in the list.
Cheers
How To Capture Mouse-click Event For A Paragraph In MS WORD.
Friends,
Some of the buttons in MS office toolbars have additional functionality when you double click them.. e.g. Format painter button in Word. When this button is double clicked it stays selected and subsequent document clicks are captured and the selected word/sentence are formatted. I want to make a similar button which remains pressed when it is double clicked and then inserts a word at the curser position whenever i click the document.
Would be glad if someone helps me in this.
Laila
Combo Box Click Event Problems
Hi there,
I am having some problems with a combo box operating style 2 which makes the combo box act like a list box. The problem i'm having is that if I tab to the control then use the arrows keys to select the item i want it executes the click event instead of the keypress event, is it something I am doing wrong?
Cheers
[??Resolved??][VB6] Combo On Click Event
Hello all,
I have a combo i wish to be able to double click and then show a form.
when i use the following code the and run it i don't get any execution
Code:
Private Sub cboJobCode_DblClick()
MsgBox "ss"
frmJobCodes.Show
End Sub
this also does not work
Code:
Private Sub cboJobCode_Click()
MsgBox "ss"
frmJobCodes.Show
End Sub
do i need to set a property value prior to this event executing.
thanks in advance
David
Preventing Combo Box Click Event
I have 8 combo boxes on a form. They all contain the same (dynamically generated data). The list in each combo box might look like:
1
2
3
4
10
11
When you select say '4' from one of them - '4' disappears from the others. If you change your mind it goes back.
I have done this using an array that holds all the info which (sort of) looks like this:
Text---ComboBox----Selected---Show
1----------0------------0--------1
2----------0------------0--------1
3----------0------------1--------1
4----------0------------0--------1
10---------0------------0--------0
11---------0------------0--------1
1----------1------------0--------1
2----------1------------0--------1
3----------1------------0--------0
4----------1------------0--------1
10---------1------------1--------1
11---------1------------0--------1
etc
Each time an item in one of the combo boxes is selected I update the array and then clear the combos and rebuild them.
In the example above the first combo box in the control array is showing '3' and does not have '10' in the list.
The second combo box is showing '10' and does not have '3' in the list.
This bit all works fine.
What I can't get working is setting the listindexes again.
As soon as I write:
Combo1(0).ListIndex = 2
The Combo1_Click(Index as Integer) fires again and an endless loop is set off.
So I have my combo boxes all built with the right things in the list but I can't set the ListIndex to show what was selected!
Can I cancel the event somehow when the line ...
Combo1(0).ListIndex = 2
executes?
Thanks for any help. Hope this is clear.
Combo Double Click Event
when i try to code it does not work.... did any one try it out
what is the use of it..
Code:
Private Sub Combo1_DblClick()
MsgBox "Combo1_DblClick"
End Sub
thanks
Click Event In Combo When Value Is Changed
Hello,
I've got a form with a few combo boxes on it. The style of the boxes is set to "2 - Dropdown List"
in some other code i set the value of the comboboxes to something: eg
combo1.text = "hi there"
but when i do this it fires off the "click" event of the combo box (which does a whole heap of other processing that i don't want to do unless the user itself clicks the combo box - not when i change it programatically).
Is there a way to avoid the click event firing when the text of the combo box is set from within the code. I still want it to happen when the user actually clicks the combo.
Thanks - it's a bit important
if i'm not being clear then ask me - i'll explain better.
Mark
Combo Box, Set Value And Click Event Problem
Hello again everyone
A quick question and hopefully a particularly easy one.
Is there an event that will tell me when the user has changed the value within a combo box which will not be raised if I change the combo boxes value within my code? I currently use the Click event but this is both raised by the user but also by my code when it changes the combo box value.
Thanks
Christopher
P.S. I have included some simple code to display my problem, you just need to add a combo box and timer to a new form and then add the following code. (I know it is very simple but I just wanted something that showed my problem. )
Code:
Option Explicit
Private iChangeValue As Integer
Private Sub Combo1_Click()
MsgBox "I have been clicked, or so I think anyway!"
End Sub
Private Sub Form_Load()
' Lets state the obvious!!
Combo1.AddItem "Scotland"
Combo1.AddItem "Is"
Combo1.AddItem "Very"
Combo1.AddItem "Wet"
Combo1.AddItem "Just"
Combo1.AddItem "Now!"
Timer1.Enabled = True
iChangeValue = 1
End Sub
Private Sub Timer1_Timer()
Combo1.ListIndex = Combo1.ListIndex + iChangeValue
If ((Combo1.ListIndex = (Combo1.ListCount - 1)) Or (Combo1.ListIndex = -1)) Then
iChangeValue = iChangeValue * -1
End If
End Sub
|