seting focus on a control
-
how do you default the focus to be on a certain control when a dialog comes up? the following line in the constructor is not doing it. this.m_OkButton.Focus(); Elena
-
how do you default the focus to be on a certain control when a dialog comes up? the following line in the constructor is not doing it. this.m_OkButton.Focus(); Elena
Set the
TabIndex
of the control you want to have initial focus to 0, adjusting the other controls withTabStop
enabled. You can do this easily in VS.NET by click the View->Tab Order when a form is open in the designer. TheFocus
method only works when a control (including a form) is already open.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----