Z
zacks
I am working on an application that has a UI that supports multiuple
functions by means of a group of "plug ins". Each plugin is a class
library. Each plugin contains a User Control that defines the controls
for that plugin's main form. The UI has a PictureBox control that is
nothing but a contain to add the UserControl from the selected plugin,
so that when the user selects a plugin, the main form changes
appearance to the UserControl in the selected plugin. When the UI
first launches, it loads the plugin from the last time the app was
shut down.
My problem is this. Whether the application first launches or the user
selects a different plugin, I cannot get the first control in the
UserControl to have focus. Each plugin's UserControl has a special
Initialize method that the plugin inovkes when it is loaded to set
some initial values. In one plugin, it populates a ComboBox. I have a
statement in the UserControl's Initialize method to set the focus to
the first control in the UserControl, but it doesn't seem to work. The
first control in each plugin's UserControl never gets focus
automatically, I have to click in the control for it to get focus.
Any idea how I can achieve this? I have tried to invoke the first
control's Select method instead of the Focus method and that doesn't
help.
functions by means of a group of "plug ins". Each plugin is a class
library. Each plugin contains a User Control that defines the controls
for that plugin's main form. The UI has a PictureBox control that is
nothing but a contain to add the UserControl from the selected plugin,
so that when the user selects a plugin, the main form changes
appearance to the UserControl in the selected plugin. When the UI
first launches, it loads the plugin from the last time the app was
shut down.
My problem is this. Whether the application first launches or the user
selects a different plugin, I cannot get the first control in the
UserControl to have focus. Each plugin's UserControl has a special
Initialize method that the plugin inovkes when it is loaded to set
some initial values. In one plugin, it populates a ComboBox. I have a
statement in the UserControl's Initialize method to set the focus to
the first control in the UserControl, but it doesn't seem to work. The
first control in each plugin's UserControl never gets focus
automatically, I have to click in the control for it to get focus.
Any idea how I can achieve this? I have tried to invoke the first
control's Select method instead of the Focus method and that doesn't
help.