TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Derek Wharton
NA
5
0
Automatically Populate form from text box value when it opens
Aug 18 2008 2:05 PM
Here is a newbie question for you.
I have a main form that opens a second form like this
private void button2_Click(object sender, EventArgs e)
{
Form3 form3 = new Form3();
form3.employeenumberToolStripTextBox.Text = employeeNumberTextBox.Text;
form3.Show();
form3.Owner = this;
}
When form3 opens, I have to click the enter button again (has the information from form1 textbox) to populate the form. How can I automatically have the click event activated when the form opens instead of having to click the enter button?
Does this make sense?
My form3 looks like this:
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
private void sp_CLE_SelectRowBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.sp_CLE_SelectRowBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.employee_DataDataSet);
}
private void button1_Click(object sender, EventArgs e)
{
try
{
this.sp_CLE_SelectRowTableAdapter.Fill(this.employee_DataDataSet.sp_CLE_SelectRow, new System.Nullable<int>(((int)(System.Convert.ChangeType(employeenumberToolStripTextBox.Text, typeof(int))))));
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}
}
}
Reply
Answers (
4
)
Help with saving images
name resolution issue