how do i check if a control has got focus?
I''m adding a cut copy paste button for my form (in Visual Basic). Cutting is simple enough I cycle through every control if it''s a form and it''s got highlighted text then add it to the clipboard. Pasting however is harder I cycle through every control and check which control has got focus, and use the clipboard gettext method.
How do I check if it''s got focus?
GetFocus
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ ]
[ MS RTFM [MSDN] | SGI STL Docs | Boost ]
[ Google! | Asking Smart Questions | Jargon File ]
Thanks to Kylotan for the idea!
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ ]
[ MS RTFM [MSDN] | SGI STL Docs | Boost ]
[ Google! | Asking Smart Questions | Jargon File ]
Thanks to Kylotan for the idea!
Nope. Doesn''t show up as a property or method. Here''s the code it might help:
Public Sub Paste()Dim iControl As Control''cycle through every controlFor Each iControl In frmHospital.Controls ''if the control is a textbox If TypeOf iControl Is TextBox Then If iControl.checkifit''sgotfocushere Then ''paste it End If End IfNextEnd Sub
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement