'C# QUICK TIPS 'How to make a form act like a dialog form 'Be sure to set these properties: ' Accept Button DialogResult = OK ' Cancel Button DialogResult = Cancel ' Be sure to set text properties of the labels as shown (&Last Name) ' Set UseMnemonic property of labels = True (default) ' Set tab order: ' Label1 =0 ' Textbox1 =1 ' Label2 = 2 ' Textbox2 = 3 ' Buttons 4 & 5. 'When you set the dialogResult prop for a button, you can examine the results from the for like you 'would a Messagebox or other dialog. 'By setting Access keys to a label and setting the tab order as shown, it can be used to move to the next 'item in the tab order. 'The UseMneumonic property, when on, makes the label respond to the access key, then it moves to the control 'which is next in the tab order. This lets us use access keys to move around the form. 'The LinkVisited prop changes the color of the link as in a web page. It uses the VisitedLinkColor property. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Dialog_Form { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void LinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { DialogResult myResult; Form2 myForm = new Form2(); myResult = myForm.ShowDialog(); if (myResult == System.Windows.Forms.DialogResult.OK) MessageBox.Show("Your name is " + myForm.TextBox1.Text + " " + myForm.TextBox2.Text); LinkLabel1.LinkVisited = true; } } }