|
-
Aug 6th, 2009, 05:16 PM
#1
Thread Starter
Lively Member
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?
VB n00b with stupid questions
Home site keywen.com
-
Aug 6th, 2009, 07:52 PM
#2
Thread Starter
Lively Member
Re: How to set focus to an object in a Form?
Please help I reaaaaaaaaaaaaaaaaaaaaly need this
VB n00b with stupid questions
Home site keywen.com
-
Aug 6th, 2009, 08:07 PM
#3
Re: How to set focus to an object in a Form?
-
Aug 6th, 2009, 08:58 PM
#4
Thread Starter
Lively Member
Re: How to set focus to an object in a Form?
flashcontrol.focus gives our error, not declared
VB n00b with stupid questions
Home site keywen.com
-
Aug 6th, 2009, 09:16 PM
#5
Thread Starter
Lively Member
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
Last edited by nusaki; Aug 6th, 2009 at 09:21 PM.
VB n00b with stupid questions
Home site keywen.com
-
Aug 7th, 2009, 01:22 PM
#6
Thread Starter
Lively Member
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
VB n00b with stupid questions
Home site keywen.com
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
|