Tulpep / Active-Directory-Object-Picker

The standard Active Directory object picker dialog for .NET
Other
87 stars 20 forks source link

Dialog being shown in top-left of screen. #10

Closed astutecat closed 9 years ago

astutecat commented 9 years ago

Is it possible to include a property such as FormStartPosition or similar to control when showing the dialog in order to set its position on the screen to the center of the owner window? at the moment, the dialog always appears in the top-left of the screen.

ricardopolo commented 9 years ago

@astutecat just before open it create a form an position it where you want.

Then past that form as the parent of your Picker.

var parent = new Form();
parent.StartPosition = FormStartPosition.CenterScreen;
DialogResult dialogResult = picker.ShowDialog(parent);

You can change the position using things like

parent = parent.StartPosition

and

parent.Location = new Point(10, 10);

Dont hesistate to tell us if you have another problem.