hi ....
I have create a UserControl (ColorPicker) that have a button that when it clicked it will create form and use it as dialog box
everything work fine but my problem is am trying to set the location of dialog box
I try to change the parent of dialog box and I have no luck on it
also I try to set the location and it's did not accepted
Public
Class ColorPicker Private Frm As New Windows.Forms.Form Private Sub ColorPicker_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load With Frm.Size =
New Drawing.Size(189, 197).FormBorderStyle = Windows.Forms.FormBorderStyle.FixedDialog
.ControlBox =
False.AutoSize =
True : .AutoSizeMode = Windows.Forms.AutoSizeMode.GrowAndShrink.Location =
New Drawing.Point(X, Y) End With End Sub Private Sub ColorButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ColorButton.Click, ColorBox.ClickFrm.ShowDialog()
End SubEnd
ClassI need to set X, Y location under the buttom location

Location for dialog box
SureshGubba
i-code-4-fun
Thanks nobugz
it's work like what you said
IRANEW
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New Form
With frm
.Location = Me.PointToScreen(New Point(Button1.Left, Button1.Bottom))
.StartPosition = FormStartPosition.Manual
.Size = New Size(189, 197)
.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedDialog
.ControlBox = False
.ShowDialog()
End With
End Sub
Mike Hildner