How to set focus to an object in a Form?
I’m making program with Shockwave Flash Object inside. Flash object generates text that can be highlighted and copied. I’m trying to click on flash text and select it but don’t happen, I think it’s because Flash object is out of focus so send keys doesn’t work.
Here is my code:
Code:
Clipboard.Clear()
Activate()
Windows.Forms.Cursor.Position = New System.Drawing.Point(31 + Me.Bounds.X, 354 + Me.Bounds.Y)
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
SendKeys.Send("^a")
System.Threading.Thread.Sleep(100)
SendKeys.Send("^c")
What should I do? or is here another way?:mad:
Re: How to set focus to an object in a Form?
Please help :cry: I reaaaaaaaaaaaaaaaaaaaaly need this
Re: How to set focus to an object in a Form?
Re: How to set focus to an object in a Form?
flashcontrol.focus gives our error, not declared
Re: How to set focus to an object in a Form?
OK I did this instead
Code:
Clipboard.Clear()
Windows.Forms.Cursor.Position = New System.Drawing.Point(31 + Me.Bounds.X, 354 + Me.Bounds.Y)
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0)
Windows.Forms.Cursor.Position = New System.Drawing.Point(65 + Me.Bounds.X, 382 + Me.Bounds.Y)
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
Activate()
Windows.Forms.Cursor.Position = New System.Drawing.Point(198 + Me.Bounds.X, 181 + Me.Bounds.Y)
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0)
Windows.Forms.Cursor.Position = New System.Drawing.Point(228 + Me.Bounds.X, 250 + Me.Bounds.Y)
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
Me.Activate()
Me.TextBox31.Focus()
TextBox31.Text = TextBox31.Text.Replace("%", "")
Instead of clicking ^a ^c it double clicks on text to select it, then right click on it and chose copy. Then it goes to a text box and does right click on it and chose paste text.
But after this I can’t work with textbox text why? I can’t do this
Code:
TextBox31.Text = TextBox31.Text.Replace("%", "")
It wont replace text!!! PLEASE HELP ME
Re: How to set focus to an object in a Form?
Can someone help me please I’m been trying to do this for over a week