private static void DisplayOptions() { UcOptions ucOptions = new UcOptions(); using (CommonForm fm = new CommonForm()) { fm.AddControlForDialog(ucOptions, "Preferences"); fm.ShowDialog(); } }
private void ShowAbout() { UCAbout ucAbout = new UCAbout(); ucAbout.SetDeviceId("Device ID: " + Settings.Default.DeviceAddress); ucAbout.SetAboutInfo(aboutInfo); using (CommonForm fm = new CommonForm()) { fm.AddControlForDialog(ucAbout, "About"); fm.ShowDialog(); } }
private static string ObtainPassword() { if (Settings.Default.RememberPassword) { return(Settings.Default.Password); } else { UCPassword ucPassword = new UCPassword(); using (CommonForm fm = new CommonForm()) { fm.AddControlForDialog(ucPassword, "Password"); if (fm.ShowDialog() == DialogResult.OK) { return(ucPassword.Password); } else { return(null); } } } }