Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I detect what Control the cursor is at in a form?
I dynamically build a form with textboxes.
Is there a way to detect which text box the cursor is at when a button is clicked? Tried and failed with the following code (not a surprise) Function SelectedControl() as string Dim ctl As Control SelectedControl="" For Each ctl In Me.Controls If ctl.setfocus = true Then SelectedControl=ctl.name exit for End If Next ctl End Sub I suspect my problem is two-fold. 1. No way to detect current focus (can't read the SetFocus) 2. When the button is clicked, the focus moves.. Any help or suggestions appreciated. tia, Pat |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
2007 Form Control/ActiveX Control font difference | Excel Discussion (Misc queries) | |||
cursor control | Excel Programming | |||
Control Cursor movement with Tab | Excel Discussion (Misc queries) | |||
Tool Tip Text for Form control/ Active-X control | Excel Programming | |||
How to get Control M to move cursor down | Excel Programming |