473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to Reload/Refresh a form at Runtime in Windows?

139 100+
Hi All,

I am developing windows application

My Intension is
Form1().vb is Parent window and Form2().Vb is Popup window.

In Form1().VB Im writing code like this
obj=new Form2()
obj.Form2_Load(sender,e)
obj.show()

In Form2().VB Im writing code like this
Me.Visable=false
obj=new form1()
obj.show()

Here im getting Form1() window two times.Is there any way to reload form1 that was opened first time?

Thanks,
Aswath.
Oct 10 '07 #1
7 16859
Shashi Sadasivan
1,435 Expert 1GB
pass form1 as a parameter to form2

and call the show method from form2 for form1

I also noticed while calling form2 from form1, you called the form2_Load.
That is not necesary because it will be called when form2 is loaded onto the screen

cheers
Oct 10 '07 #2
bhappy
139 100+
HI,

Can u tell me how to pass form1 as parametar to form2?I dono plz give me the code.



Thanks
Oct 10 '07 #3
Shashi Sadasivan
1,435 Expert 1GB
modify the constructor

Expand|Select|Wrap|Line Numbers
  1.  class Form2 
  2. {
  3.    private Form1 frm1;
  4.    public Form2(Form1 f1)
  5.    {
  6.       this.frm1 = f1;
  7.    }
  8.    private void methodWhereForm1WillBeShown()
  9.    {
  10.       this.frm1.show();
  11.    }
  12. }
  13.  
  14. class Form1
  15. {
  16.    private void methodWhichOpensForm2()
  17.    {
  18.       Form2 f2 = new Form2(this);
  19.       f2.show();
  20.    }
  21. }
  22.  
any doubts now?

cheers
Oct 10 '07 #4
bhappy
139 100+
Hi,

Im using VB.Net.So plz give me vb.net code i can't able to understand cpp code.I want to refresh the form1() after closing/hiding form2().


Thanks,
Aswath.
Oct 10 '07 #5
nmsreddi
366 256MB
Hi,

Im using VB.Net.So plz give me vb.net code i can't able to understand cpp code.I want to refresh the form1() after closing/hiding form2().


Thanks,
Aswath.
Hello

When u r opening the second form try to hide the first form show it canot be
visible ,when ever you want it just make that visible ,
Oct 10 '07 #6
bhappy
139 100+
Hi nmsreddy,

Thanks for replay,what u written is 100% correct but my intension is Form1() is Parent window and Form2() is popup window.So Form1() should be visible when Form2() is opened.I dono how to open popup window in windows application.so im doing this way.If u know plz help me..

Thanks,
Aswath.
Oct 10 '07 #7
Shashi Sadasivan
1,435 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. Class Form2
  2.    Private frm1 As Form1
  3.    Public  Sub New(ByVal f1 As Form1)
  4.       Me.frm1 = f1
  5.    End Sub
  6.    Private  Sub methodWhereForm1WillBeShown()
  7.       Me.frm1.show()
  8.    End Sub
  9. End Class
  10.  
  11. Class Form1
  12.    Private  Sub methodWhichOpensForm2()
  13.       Dim f2 As Form2 =  New Form2(Me) 
  14.       f2.show()
  15.    End Sub
  16. End Class
Hi Mate,
Please start looking at vb/c# converters
The basic between the languages are very common, get the idea rather than trying to get code spoonfed
Oct 10 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Steve | last post by:
I'm working in PHP, but am also using JavaScript, so perhaps there is a better way to do this using more PHP code...... I setup a search screen for my database, the user enters data and submits...
3
by: eric rudolph | last post by:
I am writing a photo gallery and suppose 8 photos are displayed. When the user clicks on a button under the picture, I want it to add that picture name to a "favorites" list within the session...
66
by: Ellinghaus, Lance | last post by:
> > Other surprises: Deprecating reload() >Reload doesn't work the way most people think >it does: if you've got any references to the old module, >they stay around. They aren't replaced. ...
1
by: Cooper | last post by:
Hello, is possible to disable the reload (or update, for ie) of the a web page? If yes, what i do? Otherwise if isn't possible, what i do for to set the default value of a form when a user do a...
1
by: Mike Gifford | last post by:
Hello, I'm right now using window.location.reload() to refresh the browser. It behaves as I would want in Mozilla/Netscape, but not in IE. I want to refresh a form, but keep the cached...
0
by: Martin Ho | last post by:
Hey Everyone, I really hope there is someone who can figure out this problem. Honestly, I spent 3 days now trying to find the solution, but nothing works. I'll try to explain the problem...
1
devonknows
by: devonknows | last post by:
hi ive got this at the end of my settings page, and i want it show the fmrSearch form change the check1.value, but everytime i do it, it takes two or three attempts for it to change (having to go...
14
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I tried a google search but could not find anything. I am trying to cause one webpage to reload when a second web page is closed. The second webpage loads data into a session variable and when...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.