Hello Everyone,
I can not remember how to set focus to an object. The object is an edit box. When the dialog opens I want the cursor to be in this particular edit box.
Will you refresh my memory how to do this?
Thanks,
PepsiHog
Edit box Focus
Moderators: Dorian (MJT support), JRL
Edit box Focus
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
- Grovkillen
- Automation Wizard
- Posts: 1131
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: Edit box Focus
Set focus on the dialog instead of the element?
Re: Edit box Focus
Use SetDialogObjectFocus>
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 551
Top = 216
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 211
ClientWidth = 476
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 96
TextHeight = 13
object Edit1: TEdit
Left = 133
Top = 19
Width = 121
Height = 21
TabOrder = 8
Text = 'Edit1'
end
object Edit2: TEdit
Left = 135
Top = 58
Width = 121
Height = 21
TabOrder = 9
Text = 'Edit2'
end
object Edit3: TEdit
Left = 135
Top = 97
Width = 121
Height = 21
TabOrder = 10
Text = 'Edit3'
end
object Edit4: TEdit
Left = 135
Top = 134
Width = 121
Height = 21
TabOrder = 11
Text = 'Edit4'
end
end
EndDialog>Dialog1
SetDialogObjectFocus>Dialog1,Edit3
Show>Dialog1,
Re: Edit box Focus
Thanks JRL.
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!