473,321 Members | 1,877 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,321 software developers and data experts.

Multiple Windows without MDI (Continued)

With an application with more than one window I can display another windo

Form2 f2 = new Form2()
f2.Show()

However when I want to return to form1 what do I need to do

I tried to use Activate, but it didn't wor
if I do as I did above a new form is instantiated
Nov 16 '05 #1
8 1049
How many instances of Form1 do you have?
Nov 16 '05 #2
Hi Phil,

Try BringToFront

Happy coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #3
Morten,

I tried to use BringToFront using Form1.BringToFront() but I get an error

An object reference is required for the nonstatic field, method, or property 'System.Windows.Forms.Control.BringToFront(

Phil
Nov 16 '05 #4
That means the Form you are trying to Bring to Front does not exist. For Form2 to be able to call Form1 you need to give it a reference to Form1.

Happy coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #5
Hi Morten

I am sorry but I am new to this language and I don't understand how to give form2 a reference to form 1. I greatly appreciate you patience and your help.
Nov 16 '05 #6
"=?Utf-8?B?cHNmZWxpY2U=?=" <Ps******@aoll.com> wrote in
news:37**********************************@microsof t.com:
I am sorry but I am new to this language and I don't understand how to
give form2 a reference to form 1. I greatly appreciate you patience and
your help.


Your question isnt very specific. There are several ways to do this. If you
only have one instance for form1 you can make a static and store it there.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Get your ASP.NET in gear with IntraWeb!
http://www.atozed.com/IntraWeb/
Nov 16 '05 #7
Chad

I am writing an application that would have several windows. However I want to be able to return from any window back to the main window. Can you provide a quick example of what you mean

Thanks Phil
Nov 16 '05 #8
"=?Utf-8?B?UGhpbA==?=" <an*******@discussions.microsoft.com> wrote in
news:8C**********************************@microsof t.com:
I am writing an application that would have several windows. However I
want to be able to return from any window back to the main window. Can
you provide a quick example of what you mean?


I dont have time to write a demo - but look up how to create static members.
You can use that to store a reference and use it to reshow the forms.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Empower ASP.NET with IntraWeb
http://www.atozed.com/IntraWeb/
Nov 16 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: jing_li | last post by:
Hi, you all, I am a newbee for php and I need your help. One of my coworker and I are both developing a webpage for our project using php. We have a copy of the same files in different location...
11
by: Ohaya | last post by:
Hi, I'm trying to understand a situation where ASP seems to be "blocking" of "queuing" requests. This is on a Win2K Advanced Server, with IIS5. I've seen some posts (e.g.,...
383
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
16
by: Randy Harris | last post by:
I was inspired by the recent discussion of returning multiple recordsets to ADO from a stored procedure. (Amazed is probably more accurate). I asked about how to accomplish same with Oracle and...
60
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the...
21
by: Al Christoph | last post by:
I posted this last week end in the MSDN forums. No luck there. Let's see what the experts here have to say:-)))) I have a rather convoluted project. The distributable will come in eight...
29
by: mastermagrath | last post by:
Hi, Sorry for the possibly silly question. Am i right in saying that the C library i use on a windows machine really utilises the windows API for all its operations e.g. opening files, printing...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.