Create your own dialog boxes
You can make your own dialogs
Every form has a showdialog() method
Once a button is clicked the form disappears and dialogresult is passed back

Example (create your own dialog boxes )
- create a new project
- add a second form called dialog.vb
- drag a button to form1
- go to the new form(dialog.vb)
- add label, textbox, 2 buttons like picture below

ask for name and OK and cancel button
- Resize the form to make it smaller
- Rename the buttons btnOK and btnCancel
- Name the textbox txtName
- go into the code for the form
Select the form and click the code button on the solution explorer

readonly property username() as string
get
return txtName.text
end get
end property

- select the form and select acceptbutton property, set it to btnOK

- set cancelbutton property to cancel button

- click the OK button
- change dialogresult to OK

- change it to cancel on cancel button

- Open form1.vb
- Add a button to form1
- double click button on form1
- Add this code:
Dim namedialog As New dialog()
If namedialog.ShowDialog = Windows.Forms.DialogResult.OK Then
MessageBox.Show("You clicked Yes and entered "& _
namedialog.username)
End If
