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

creating a Form from within a Form

AK
I have a Windows Forms .NET application. I need tolaunch an entire new
Windows Form2 (with its' own designer Form2.h [Design]) off of a button click
event handler from Form1. How can I do this ?

I think part of the answer invloves going to my project & doing :
Add > New Item > Windows Form
This adds the Form2.cpp & Form2.h & Form2.h [Design].

But I'm not sure on what to add in the Form1.h button click event handler.
Here's what I've tried :

System::Windows::Forms::Form* Form2 = new System::Windows::Forms::Form();
Form2->Show();
This does launch a new window, but it's not the Form2 I created in
[Designer] - in effect, I've created two Form2's ...

Should I use :
Application::Run (new Form2()); ??

Any help would be appreciated - I'm stuck on this issue.
I can send the source code if it would help.

Regards,
ak
Nov 17 '05 #1
2 833
AK wrote:
System::Windows::Forms::Form* Form2 = new System::Windows::Forms::Form();
Form2->Show();


Form2* form2 = new Form2;
form2->Show();

Tom
Nov 17 '05 #2
AK
Yes this works - I had confused Form2 as an instance rather than a class.

Thanks for the help,
ak

"Tamas Demjen" wrote:
AK wrote:
System::Windows::Forms::Form* Form2 = new System::Windows::Forms::Form();
Form2->Show();


Form2* form2 = new Form2;
form2->Show();

Tom

Nov 17 '05 #3

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

Similar topics

4
by: Don | last post by:
hi in the past (vb 5.0) is used to create applications with multiple forms. i would hide and/or show the appropriate form depending on user input. now i'm using vb.net (still getting used to it)...
4
by: Altramagnus | last post by:
I have 30 - 40 type of different window. For each type I need about 20 instances of the window. When I try to create them, I get "Error creating window handle" My guess is there is a maximum...
1
by: James | last post by:
I am creating a system whereby equipment is inspected. Data is inputted into an inspection form. However, any equipment that is not satisfactory needs to have spare parts ordered for that piece of...
1
by: VM | last post by:
I would like to display a child form inside of an MDI but the problem is that I'll be invoking that child form from within another child form. If I use this code: frmReportViewer frmReportViewer =...
5
by: Adam Clauss | last post by:
I am creating a plugin for MS Outlook. Upon clicking a toolbar button, I create series of threads (variable number each time). Within each thread, I start a form using Application.Run(...). This...
3
by: Tim | last post by:
Dear All, I have spend a number of hours attempting to find some answers about how to remove the 3D BorderStyle within a combobox and have come to the conclusion that the simplest method is to...
3
by: EnglishMan69 | last post by:
Hello All, I am using VB2005 Beta 2 in VS 2005 and am running into a small problem. I need to be able to add a picture box to the main form from within a thread. The program goes to a web...
1
by: Marcel Hug | last post by:
Hi NG ! I have already written a task about MVC and I tried to get the best informations together. I would like to implement the MVC pattern and it work on the way I did it. At first i know the...
4
by: tshad | last post by:
I am trying to set up an Image authorization where you type in the value that is in a picture to log on to our site. I found a program that is supposed to do it, but it doesn't seem to work. ...
3
by: mjmars2 | last post by:
I am in desperate need of some assistance with some VBA code I am working on. Here's what I'm trying to do: I have two forms- is the main form and is another form that pops up when you click a...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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
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...

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.