Textbox on enter Pop up a new form or new window
Hi all i need a help i.e if i enter some thing like 1 in my text box i would like to pop up or show a window on the form how can i do this.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Marimuthu ArigovindasamyPosted Jun 28, 2010, 7:38 PM
private void tmpform1_FormClosed(object sender, FormClosedEventArgs e)
{
if (PageCount > 0)
{
tmpform1 frm = new tmpform1();
frm.PageCount = PageCount;
frm.Show();
}
}
Marimuthu ArigovindasamyPosted Jun 29, 2010, 1:03 AM
Dorababu MekaPosted Jun 29, 2010, 12:31 AM
Marimuthu ArigovindasamyPosted Jun 29, 2010, 12:28 AM
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
Dorababu MekaPosted Jun 29, 2010, 12:22 AM
Dorababu MekaPosted Jun 28, 2010, 8:10 AM
Marimuthu ArigovindasamyPosted Jun 28, 2010, 8:04 AM
Dorababu MekaPosted Jun 28, 2010, 6:13 AM
Marimuthu ArigovindasamyPosted Jun 28, 2010, 6:10 AM
f.PageCount = Convert.ToInt32(textBox4.Text);
not hard coded with 2..
Dorababu MekaPosted Jun 28, 2010, 4:27 AM
Dorababu MekaPosted Jun 28, 2010, 4:24 AM
Marimuthu ArigovindasamyPosted Jun 28, 2010, 3:38 AM
tmpform1 frm = new tmpform1();
instead of
Form frm = new tmpform1();
Dorababu MekaPosted Jun 28, 2010, 3:35 AM
Dorababu MekaPosted Jun 28, 2010, 3:30 AM
Marimuthu ArigovindasamyPosted Jun 28, 2010, 3:26 AM
from the first form did u set the PageCount like this.
2ndForm frm = new 2ndForm();
frm.PageCount = this.txtPageCount.Text;
frm.Show();
Still u r getting error, pls attach ur code.
Dorababu MekaPosted Jun 28, 2010, 3:09 AM
Marimuthu ArigovindasamyPosted Jun 28, 2010, 3:07 AM
private int _pagecount;
public int PageCount
{
get
{
return _pagecount;
}
set
{
_pagecount = value;
}
}
Dorababu MekaPosted Jun 28, 2010, 2:48 AM
'ACHWinapp1.tmpform1.PageCount.get' must declare a body because it is not marked abstract or extern
Marimuthu ArigovindasamyPosted Jun 28, 2010, 2:19 AM
Dorababu MekaPosted Jun 28, 2010, 2:10 AM
in the page that we are wishing to transfer
public int PageCOunt
{
get;
set;
}
Marimuthu ArigovindasamyPosted Jun 28, 2010, 2:06 AM
frm4.PageCount = Convert.ToInt32(txtPageCount.Text);
If u want to open the window after leaving the textbox, pls use the same code in that event. (Have to use the same code only in ur required event)
Dorababu MekaPosted Jun 28, 2010, 2:02 AM
Marimuthu ArigovindasamyPosted Jun 28, 2010, 1:33 AM
Parent window code:
private void tbPageSize_TextChanged(object sender, EventArgs e)
{
//for (int i = 0; i < Convert.ToInt32(tbPageSize.Text); i++)
//{
Form4 frm4 = new Form4();
frm4.PageCount = 2;
frm4.Show();
//}
}
New window code:
private void Form4_Load(object sender, EventArgs e)
{
PageCount = PageCount - 1;
}
private void Form4_FormClosed(object sender, FormClosedEventArgs e)
{
if (PageCount > 0)
{
Form4 frm4 = new Form4();
frm4.Show();
}
}
public int PageCount
{
get;
set;
}
Dorababu MekaPosted Jun 28, 2010, 12:43 AM
Marimuthu ArigovindasamyPosted Jun 27, 2010, 10:32 PM
Note: Validate the textbox value whether it's an integer or not
private void tbPageSize_TextChanged(object sender, EventArgs e)
{
//Validate the text box value for integer
for (int i = 0; i < Convert.ToInt32(tbPageSize.Text); i++)
{
Form4 frm4 = new Form4();
frm4.Show();
}
}
Dorababu MekaPosted Jun 26, 2010, 8:03 AM