Form1 frm=new form1();
frm.show();
in this mode my form1 values are refreshed so i want show the form with valued
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 11, 2013, 8:53 PM EDT
I didn't get your point. plz provide more details.
Jignesh TrivediRank #16 · 50.3K reputationPosted Sep 12, 2013, 12:18 AM EDT
we you create object of any form in winwows form application, at this time all values are refreshed on this forms....
hope this answer of your quesition.
please provide more information if not..
Parthiban B49 reputationPosted Sep 12, 2013, 12:20 AM EDT
For example we have 2 forms
In form 1
1 Datagridview and 2 Button Controls
Button1_click event
//Normal Data dind from database to gridview-here no problem
Button2_click event
this.hide
form2 frm=new from2();
frm.show();
//like this way i hide my form1 and show my form 2
now form2 will shown
in Form 2
for example
1 button control in there
on that button _click event
this.hide();
form1 frm=new form1();//here is the problem
frm.show();
So i want what i have in form 1 datagridview, before click the button 2
that should be displayed when i will open the particular forms
now the data gridview will gone free so i dont want that (refresh in form 1)
Parthiban B49 reputationPosted Sep 12, 2013, 12:26 AM EDT
1. any way to avoiding the refresh
2.without creating the instance we get the same result like in vb.net(me.hide() form1.show())
Jignesh TrivediRank #16 · 50.3K reputationPosted Sep 12, 2013, 12:30 AM EDT
hide method is also supported by C#
here instead of me use this
this .Hide()
Parthiban B49 reputationPosted Sep 12, 2013, 12:44 AM EDT
problem in show()
how to avoid the refresh
Jignesh TrivediRank #16 · 50.3K reputationPosted Sep 12, 2013, 1:05 AM EDT
I think, problem is you create object of form every time...
instead of doing this create form object at globle place and show form with out creating object if form object is not null.
in button click event
if(form2 == null)
{
form2 = new Form2();
}
form2.Show()
make form2 object globally accessable....
hope this will help you.
Suthish NairRank #92 · 22.8K reputationPosted Sep 12, 2013, 4:37 AM EDT
Parthiban B49 reputationPosted Sep 12, 2013, 8:05 PM EDT
Which visible change event?
Kunal VaishyaRank #990 · 2K reputationPosted Sep 12, 2013, 9:53 PM EDT
refer this link may be help full.
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.visiblechanged.aspx
Suthish NairRank #92 · 22.8K reputationPosted Sep 13, 2013, 3:59 AM EDT