|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Testapp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
DialogResult res = f2.ShowDialog();
MessageBox.Show("Result: " + res);
}
private void button3_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
f2.Text = "Confirm another action";
f2.label1.Text = "This text has been set after the original dialog has been created"
+ "(bearing a different description).\n"
+ "That way the same form class can be used in different configurations.";
DialogResult res = f2.ShowDialog();
MessageBox.Show("Result: " + res);
}
private void button2_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
MavControls.DontShowAgainCheckBox.Reset(f2);
f2.Text = "Confirm another action";
MavControls.DontShowAgainCheckBox.Reset(f2);
MessageBox.Show("DontShowAgain flags have been reset. Both dialogs will show again.");
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.