Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Cool Things~Any Body Teach Me How To Control The Mouse Moving By Typing The X And Y?


I would like to know if anybody know how to controal over a mouse by using typing the x and y it will automatic go to the direction and i press cmdleft
button it will click on the define object and i press cmdright it will also will virtual what the mouse do with the right click.
x and y is the destination.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Help Me!!!! How To Control Mouse Cursor On Other Windows? Any Body Can Help Me
I would like to control mouse cursor on other window. if you have any idear please help me. Thanks

Moving Things And Deselecting Things.
Okay, I have two questions. First I'll give you the noobish one. How do you deselect something like a command button so it's not highlighted? I also have a problem with my end of the year project I asked for help with a while ago. I'm trying to make it so that when you click a button, the notes on a measure (of music) move down to the next set of lines instead of going to the right off the screen. It's hard to explain, but here's the code for the command button:

VB Code:
Private Sub Command1_Click()intOMG = intOMG + 1If intOMG > 8 Then    Command1.Enabled = FalseEnd IfLine1(Line1.lbound + intOMG).Visible = TrueLine2(Line2.lbound + intOMG).Visible = TrueLine3(Line3.lbound + intOMG).Visible = TrueLine4(Line4.lbound + intOMG).Visible = TrueLine5(Line5.lbound + intOMG).Visible = True End Sub


Here's a picture of the form, which is probably the best way I can show you:

http://img.photobucket.com/albums/v6...r/untitled.jpg

Also, how can I make that scrollbar work? This should be my last question about my project (seeing as it's due tomorrow), so thanks to those who help.

Moving Control Along With The Mouse
Hello all,

I have two issues that I am hoping that you could help me resolve.

1- Is there a way that i can move a picture control along with my mouse. If i mopve my mouse i want the picture to follow the mouse?

2- When i create controls and add them dynamically to a form at run time how can i capture their names to access their events? ortry to refrence them and their events?

Thank you so much in advance!

Hisham

Control The Line When Moving The Mouse
Here is my code to draw a free line or shape on Picture1
It works nicely without a problem
However, when I move the mouse a little bit fast, the coutinuous line becomes broken line
is there a way to control it - I mean when you move the mouse fast, the line is still continuous?
Thx, Chris


Code:Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    If bPen = True Then
        DownX = x
        DownY = y
        MouseIsDown = True
    End If
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
    If bPen = True Then MouseIsDown = False
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    If MouseIsDown Then Picture1.PSet (x, y), CommonDialog1.Color ' vbBlack
End Sub

Change Mouse Cursor When Moving Over Control
Hi,

how can I change the mouse cursor icon, whenever the user moves over some control, usually a label control? Similar to the way mouse cursor changes when moving onto a hyperlink on a webpage.

thanx, ds

Moving Images From One Control Array To Another By Mouse Click - Resolved
Hi

Wondering if anyone can help?

I have two Control Arrays the first has 50 images in it all with pictures the second has five images in it all without pictures

What I’m trying to do is to move Images from one control array to another by clicking on the mouse button.

I have code set up in the Images DragDrop event allowing me to move the Pictures from the first control array to the second.

I find this to be very time consuming for the user and I think if they also had the option of clicking on the Images in the first Control Array to send the picture to the first available Image in the second Control Array then it would less time consuming for the user.

I can get the picture to move from the first Control Array to the second with the following code


Private Sub ImgDeck_DblClick(Index As Integer)

ImgDeck(Index).Picture = ImgP1Hand(Index).Picture

ImgDeck (Index).Picture = LoadPicture()

ImgDeck (Index).DragIcon = LoadPicture()

End Sub



Which seems ok as far as it goes but it doesn’t take into account whether the Image in the second Control Array all ready has a picture in it and if it does then it simply wipes over it.

What I want to happen is that if ImgHand(0) has a picture in it I want the picture to automatically go to the next image in the Control Array ImgHand(1) etc.. Until all the Images in the second control Array are full the maybe a MsgBox will pop up stating as many cards as possible have been selected.

Does anyone know the code for this?

Any help would be greatly appreciated.

Moving ListBox To Typing Position.
Hey,

I have a question for you that seems to me as if it could be a hard one... I have not been able to find anything about it, mainly because I haven't got a clue as to where to look for...

I made some sort of AutoComplete feature in my program (in a RichTextBox), and it would be really nice if I could make it similar to Visual Basic's "Auto List Members" option (which is the listbox popping up with possible keywords when you type a ".")

I want a ListBox to become visible whenever the program is autocompleting a word, that lists all other possible keywords (because there are often multiple).

I want this ListBox to appear at the location of the I-beam (selection thingy).

How can I get it to move there? Is it possible to find the Top and Left location of the I-beam inside a RichTextBox somehow? I doubt it...
Can it be done otherwise?

Moving Things*
Ok, i have a shape that moves across the form (looping)

i have a timer that subtracts 10 out of the shape.left every 1 sec. from time to time i want to change the speed of this, like (-20) (-30)
etc......
so far i tried the following

Yellow1.Left = Yellow1.Left & Text1.Text

Obviously this did Not work, lol.
Does anyone have any better suggestions on accomplishing this? Thanks

Controling The Mouse And Typing.
is there a way to make the mouse goto and click on a specified colour, also is there a way to make it type something without u touching anything?

if u have any questions plz ask,

rob

Moving Things Between Frames
How do i move for instance a label between 2 frames? i tried with label1.container but that didnt work very well, so i guess thats not what its used for or im doing something else wrong.

Moving Things Into Tabs
i have a bunch of labels and text boxes that are in a form. i just discovered the tab function and when i try to move them into the tab they just end up going underneith. how do u get them to go on the tab?

Help With Moving Things In Arrays
Hey people.

Here is my problem.

I have an array of a size 10. Anyway i want to know how to delete and item in the array and move every item in the array down one so that it fills the empty space. So that I have no empty spaces in the middle of my array only at the end of it.

I have puzzled on it for ages.

Any help would be aprreciated.

Moving Things From One Listview To Another
Hey guys I have one listview called report on a form call antivirus. This listview has checkboxes.

I have another listview with no check boxes on a form call resuls.

What I would like to do is when an item or items is checked, whatever is in the first column of the report listview on the antivirus form goes in the results listview on the resuls form. The same as the second column, I would like that repeated as well.

But the twist is if the user checks a problem and then presses the delete button. I would like the 3rd column of the results listview on the resuls form to say "Deleted" for that checked item.

OR if the user checks a problem and presses ignore then it would just say Ignored by the item in the 3rd column.


Can anyone tell me how I could do all that?

Thanks!

Need Help With Timers And Moving Things
I'm trying to use a timer that every time it refreshes, it will move the image up a little till a certian point then move it back this is the basic part if some one can answer this for me then i'll ask my next question.

Moving Things From A Listview To A Textbox?
Hey guys I have a listview called report and it has check boxes. I have another form called form2 with a text2.text.

Is there a way when I check one item and press a button that checked item goes in the text2 of the form2?

Its just the item from the first column of the report listivew.

Thanks!

Please, Teach Me How To Control Powerpoint File In VB. Please.......
Does anybody know how to open existed ppt file and how to move to next or previous slide by using command buttons in VB?

Please, let me get some information of it if anyone has it or if anyone has some sources related to it.

Thanks very much in advance!

Typing In Combo Box Differs From Selecting With Mouse Or With ArrowKeys In VB, Help Pls !
Hai ,

I am using Crystal Report 8.5 , VB and Ms Sql server is my Database. I am adding Items to the Combo Box in the Form Load as below and I added "All" Manually to facilitate the user to view all the Item Details if he select "All" from the Combo.

While Not rst.EOF
cmbFrom.AddItem rst!Itemcode
rst.MoveNext
Wend
cmbFrom.AddItem "All"

The below is my code in the Command button to view the report according to the Text in the Combo BoPrivate Sub cmdIpview_Click()
txtFrom and txtTo is the text box to pass the From Date and To Date to the Report and cmbFrom is the ComboBox which displays the ItemCode, which I am passing as a parameter.

All working fine for me except one thing. (i.e) If I Type in the ComboBox and Click the command button the report for that Particular ItemCode is not showing, its showing the Report for All, Actually when I choosed a Particular Itemcode in the ComboBox its showing correctly the Report for the Itemcode which I choosed, but why its not comming when I type. Its taking the First line in the IF statement True and executing. When I type a Itemcode in the ComboBox the statement after Else should be executed. How can I make this. I put a break point and checked, its going to the If Statement and executing before Else condition.
Code:
ifdt = txtfrom.Text
itdt = txtIto.Text
If cmbFrom.ListIndex = -1 Or cmbFrom.Text = "All" Then

CrystalReport1.ReportFileName = App.Path & "items.rpt"
CrystalReport1.Formulas(1) = "fdt='" & ifdt & "'"
CrystalReport1.Formulas(4) = "tdt='" & itdt & "'"

strsf = "{SalesTable.SellingDate} in Date(" & _
Format(ifdt, "YYYY,M,D") & ") to Date(" & _
Format(itdt, "YYYY,M,D") & ")"
CrystalReport1.ReplaceSelectionFormula (strsf)
CrystalReport1.Action = 1

Else

CrystalReport1.ReportFileName = App.Path & "item.rpt"
CrystalReport1.Formulas(1) = "fdt='" & ifdt & "'"
CrystalReport1.Formulas(4) = "tdt='" & itdt & "'"
strsf = "{StockTable.ItemCode} ='" & cmbFrom.Text & "' AND" & "{SalesTable.SellingDate} in Date(" & _
Format(ifdt, "YYYY,M,D") & ") to Date(" & _
Format(itdt, "YYYY,M,D") & ")"
CrystalReport1.ReplaceSelectionFormula (strsf)
CrystalReport1.Action = 1

End If
CrystalReport1.GroupSelectionFormula = ""
End Sub


The Code which I send you belongs to a Function, this funtion will be called when the command button is pressed,


1. The User May or Maynot choose the text from the Combobox. If he choose a Particular Product from the Combo the Fucntion will execute the Else part in the If statment which is used to Display the details in Report about the particuar Product which the User had selected in the combo, Otherwise if the user didn't choose the Funtion will execute the statement statement before Else part which is used to display all Product details.
2. The user will choose the Option button for example there are four or Five Option Buttons like Salesman wise, Productwise, Invoice Wise and
3. The user will enter the date in two Textboxes, i.e From Date and To Date and finally presses the Command Button.

In this place while pressing the command button the funtion should execute as I stated above, its working correctly when the user choose through mouse, but when the user type a particular item which is available in the combo box list and press the command button, it shows all the details of the Products, that is what happens is the Else part is not executing

Thank you very much,
Chock.
itchocks@rediffmail.com



<HTML>
<B><font color="#008000">HAVE A NICE DAY !</font></B>
<HTML>

Moving The Mouse And Clicking Mouse Buttons With Software
I am trying to move the mouse and press buttons using software. I have figured out how to move the mouse using the Cursor class, but I can't figure out how to create mouse clicks.

If that isn't clear enough, here is a simplistic example of the program I am trying to complete:

1. Move mouse to screen coordinate 100,100

2. Left Click


Code would be great, but I'm really just looking for a shove in the right direction. I've been pouring over MSDN and I can't find anything.

Help On A Cool Control
Hey, first of all let me say that I HAVE DISCOVERED THE BEST CONTROL EVER!!!!!. And this control is the MSInet control. What it will allow you to do is get graphics off the internet. What I want to know is how to get text off the internet. I know there is a way but I just can't figure out how!!. Anyways for those of you who don't know about the great control, here is a sample of it. Note: This will get a graphic off the internet. To find the address of the graphic in Internet Explorer goto View and then source look for the address here(you must know some html to do this.

'This is the codeing to get a graphic off the internet
'A MSInet control must be present

Private Sub Form_Load()

Dim file() As Byte

file() = Inet1.OpenURL("Address Of The Picture",cByteArray)

Open App.Path & "data2.jpg" For Binary As #1
Put #1, , file
Close #1
Image1.Picture = LoadPicture(App.Path
"data2.jpg")

End Sub

Typing Unicode In Vb Control
Dear sir,
I have VB 6.0 (SP6) Application in Windows 2000 Professional (SP4), a locale is English (US)
I added all groups of languages, so a system could read and write documents in multiple languages(keybord layout/IME).
I am using Nepali unicode(sanskrit-Nepali unicode romanized). When i type nepali unicode in text box then ????? comes. I come to know that Visual basic text box doesn’t support Unicode. But vb’s forms 2.0 support Unicode. I am able to display Unicode in forms2.0. But i don’t know how to type Unicode in textbox or forms2.0 textbox. Is their any useful project or link concerning unicode and vb's control. If anyone know where I can find free Unicode enabled vb control(not trial version) then it will be very helpful to me.
I have to store unicode in access database through text box and retrive data in textbox.
thank you

Cool Bar ActiveX Control
I'm using the cool bar control in my ActiveX project, it all works fine. However when I use the package and deployment wizard to build an internet package cab file and distribute it via the web my activeX control fails to display. If I then open the VB source code on the machine it failed to display on the cool bar control fails with the error 'license required in design view'. Other machines I try except the download cab file and display my control OK and when I view the source code I get the cool bar on the form as expected. Where do I get the cool bar license from and why does it require one?

many Thanks

arh

How Do I Give My Control A Cool Property Editor?
you know hwo with certain controls, liek common dialog, when you right click them in the IDE, you can open their special property editor thing, instead of having to use the property stuff on the riight? hwod o i make one of these?

Typing Newline Characters Directly Into Control Fields
Is it possible to add a newline character directly to a control at design time such as in the ToolTipText field to save having to write code to do it? Thanks for any info

How To Search A Data Grid By Typing Text Into A Control
How to search a data grid by typing text into a control
help mi please
hurry

this data grid is connected with database
when i type something in text box (name or something) and press button i would like to some only this file that is related with that name

Moving Mouse
I want to make my mouse move after a period of time using timer, I have got the code of changing position.. but I don't know how to put it in a timer (below)...



Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long

Private Type POINTAPI
X As Long
Y As Long
End Type

Private Sub MoveMouse()
Dim pt As POINTAPI
GetCursorPos pt
SetCursorPos pt.X, pt.Y - 40
SetCursorPos pt.X, pt.Y
End Sub




and my timer with other statements:

Private Sub Timer1_Timer()
Dim X As String
X = "Windows is on"
Print X
End Sub

Mouse Moving
Here is the code I Have so far.....


Code:
Option Explicit
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" _
(lpPoint As POINTAPI) As Long
Dim Pt As POINTAPI

Private Sub Timer1_Timer()
GetCursorPos Pt
lblxpositon.Caption = Str$(Pt.X)
End Sub
It works fine.

I want to know where the actual number is located in and how I could change that number. What I want is to move the mouse up 200 every time it gets to 350.

Something like


Code:
If GetCursorPos.Pt = 350 Then
GetCursorPos.Pt = GetCursorPos.Pt + 200
End if
This is a complete guess and i'm sure it is wrong

Thanks
Edit by moderator: Please post your threads in the appropriate forum.

Moving The Mouse?
I'm making a macro program and want to move the mouse to a specific location on the screen, but I each macro file to operate independantly of screen resolution.... how can I do that? The optimal way to do this would be to get a percent, multiply times the resolution and then move the mouse there and click, but any ideas?

Thanks!
sirSolarius

Mouse Not Moving?
is there a way of detecting if the mouse has not moved for x seconds? I want to display a screensaver within my app based on this.. similar to how MSN sets your status to 'away' if you dont move the mouse for x seconds

Help Moving Mouse
In VB6 i'm trying to move my mouse around the screen and click. so for i found a code to move my mouse but i can't find out the coordinates for off my program and how to tell the mouse to move. heres my code:
Code:
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, _
ByVal Y As Long) As Long
Private Declare Function ClientToScreen Lib "user32" (ByVal hWnd As Long, _
lpPoint As POINTAPI) As Long
Sub MoveMouseCursor(ByVal X As Long, ByVal Y As Long, _
Optional ByVal hWnd As Long)
If hWnd = 0 Then
SetCursorPos X, Y
Else
Dim lpPoint As POINTAPI
lpPoint.X = X
lpPoint.Y = Y
ClientToScreen hWnd, lpPoint
SetCursorPos lpPoint.X, lpPoint.Y
End If
End Sub

Moving The Mouse
If i click on a picturebox how can i get it so the mouse moves to the top left of the picture box?

Moving Mouse
How can I move the mouse using a timer so it move the mouse from its position to another one every 2 or 3 minutes for example..


Thanks for help,
zeid

Mouse Moving
If the leftmousebutton is pressed (and hold down) the mousepointer has to move upwards or sideways smoothly.

Any idea where to start or what to use?

Moving Mouse
I use the code below for detecting if the computer is idle, how can i detect if the mouse is being moved or keys are being pressed?


VB Code:
Private Sub ActivityTimer_Timer()    Static lNotActive As Long    Static LastCursorPos As POINTAPI    Dim CursorPos As POINTAPI    Dim lCounter As Long            'Count another second    If start = 0 Then GoTo end2    If pauseclick = 1 Then GoTo end2    lNotActive = lNotActive + 1     'Get the current position of the mouse    GetCursorPos CursorPos        If (CursorPos.x <> LastCursorPos.x) Or (CursorPos.y <> LastCursorPos.y) Then        'The mouse has moved         'Save the new position        LastCursorPos = CursorPos        'Reset the seconds count                        lNotActive = 0    Else        'The mouse hasn't moved, check the keys        For lCounter = 0 To 255            If GetAsyncKeyState(lCounter) <> 0 Then                'The key was pressed, reset the counter                lNotActive = 0            End If        Next    End If        If lNotActive = 2 Then        pause2_Click        notactive = 1    End Ifend2:End Sub

Moving Tha Mouse???
da_silvy, im prolly doin somethin wrong but... i added a timer and under "Private Sub Timer1_Timer()" i pasted yo code, and when i press play an error pops up sayin "Compile error. Only Comments may appear after end sub end function or end property."

just so u know im new to visual basic so...

Moving The Mouse
Is there a way to actually move the mouse pointer via code?

Mouse Moving
hi

im am a vb newbie and have a question:
i found this commands to move the mouse cursor:

Declare Function SetCursorPos& Lib "user32" _
(ByVal x As Long, ByVal y As Long)


t& = SetCursorPos(0,0)


when i copy this commands in a *.vbs file it doesnt work
what commands must i add that it works?
please help me. without help i will never learn visual basic


thanks

Any Body Used This Text Control
hey frns

any body used TX Text Control version11 .

please reply if any body used it. i got some problem with it .

thanks & regards
pc

Moving Image W/ Mouse
I wanted to have an image move according to the mouse cursor. I've managed to do that with a mousemove procedure on the form. However, the image moves fine on the right side of the screen, but the image doesn't move so smooth on the left side. I'm not sure why there would be a difference, and I cannot change the effect.

Moving Mouse Over The List Box
Hi, I am trying to manually make my own Menu Editor. I don't like how you cannot edit the font and color of the regular menu editor.I got it all working and looking great, but there are 2 small problems that I cannot figure out how to fix.

I want to be able to move the mouse over a list box, and just like a regular menu I want the one that is under the mouse to be highlighted. And as you move the mouse over different selections it will highlight them, without yet clicking on the mouse, anyone know how to do that?

Also, does anyone know how to change the forecolor of a command button? It is possible?


I appreciate any help.

Thanks,

Dan

Moving An Image With The Mouse
hey all, just wondering if anyone could point me in the direction of moving an image by clicking on it, and while holding the mouse button down and moving it in any direction, how to change the properties of the image(in this case, the .left, or .top properties)
Thanks in advance.

Moving Object By Mouse!
Ok I have a bit of Newbie problem..(I quess)

I have a form with a (small) pictbox control and like it to move around the form when/where ever I move the mouse. I don't want to drag en drop I don't even want to "click" first before moving. Now I sort of have this working for one small detail. As an object is basicly moved by changing its Left and top posision to x and y there doesn't seem to be a way of moving it by its midpoint possision or in otherwords the center of the object (pictbox) doesn't seem to be stucked to the mouse. So my pictbox only moves when I put my mouse pointer to the left border of the pictbox, the movement is then fine, but when I move to the right, the pictbox doesn't move before I "hit" the right border and then it doesn't move but sort of jumps to the "new" left posision.
making the movement not very smoothly..the same happens up and down! (up works better than down)

So I actually only sort of want to stick my mouse pointer to the center of the pictbox and then move it (maybe I should just use a piece of tape uh..)

Moving Text Box With Mouse
Hi,

I have a text box within a picturebox which I want to move when I hold down the mouse button.

I have tried using the X and Y coord for the mouse but cant get the calculation right.

heres the code in module:


Code:
Private Type POINTAPI
X As Long
Y As Long
End Type

Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

On the form:


factor = 1


Code:
Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
GetCursorPos P
P.X = Int(P.X / factor) * factor
P.Y = Int(P.Y / factor) * factor
TextX = P.X - Label1.Left
TextY = P.Y - Label1.Top
Timer1.Enabled = True
End Sub

Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Timer1.Enabled = False
End Sub

Private Sub Timer1_Timer()
GetCursorPos P
P.X = Int(P.X / factor) * factor
P.Y = Int(P.Y / factor) * factor
Label1.Left = P.X - TextX
Label1.Top = P.Y - TextY
End Sub

When I click and move the mouse, the label moves but not under the mouse. it moves about an tenth the distance.

I ahve attached the sample code as well.

Cheers,
pG

Moving A Button With Mouse?
Hi all, well i am new to excel VB and was wondering how i can create a userform with a command button that moves when my mouse goes over the button?

I am really new so if it's possible could it be in doled down terms

Cheers

Moving Mouse Pointers
Is there I was I can move the mouse pointer in my program? Example, when user clicks on something, the program moves the pointer to a particular point on the form, like the pointer, "jumped," to that location.

I have no clue if VB can do this. Is there like a Mouse.Goto(x,y) function?

Moving Mouse Pointer
Hai everybody,

Is there any method to move the mouse pointer from one point to another point on the form at run time.
Thank you all.

Moving Form With Mouse
I am making a program that requires me to be able to move a form by clicking and dragging it. Except it doesn't have a border so it won't work. On top of that, I want to be able to click a picture on the form and drag the entire form. How can I do that?

Auto Moving The Mouse
hi, wat i wana be able to do is move the mouse over a certain button or sumfing on the form, for example i wana be able to move it so its over the exit button if a condition is met.

also ive got some plans for animation purposes where i wana show the mouse moving across the screen, but i dont wana use pictures of mouse cursers, if u c wat i mean

thanx

andy

Moving A Form Around Using The Mouse
Hi

I have an application that I have removed the title bar and control box because I have customised the graphics. With the loss of the title bar and window controls I have also lost the ability to move my application around on the desktop. What code do I need to make my form move with the movement of my mouse?

Thanks for any help

SC

Moving The Mouse Arrow
Does anyone know if API calls can be used to place the mouse arrow over a program button on the taskbar?

I am using Excel VBA.

Any help would be appreciated.

Copyright © 2005-08 www.BigResource.com, All rights reserved