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

Unable to display form

Greetings,

I have a "newbie" question related to forms. I am attempting to use the
code below to open up another form when the user presses the "OK" button
(after making the appropriate selection from a combo box). However, I
am receiving an error at the following line of code:

TestNumber.ActiveForm.Show();

"TestNumber" is the name of the second form that I want to display. The
code for this routine is below:

private void btnOK_Click(object sender, System.EventArgs e)
{
string strChoice = this.cboChoice.Text;
switch (strChoice)
{
case "For Loop":
TestNumber.ActiveForm.Show(); <-- Error occurs here
break;
case "While Loop":
...
break;
}
}

Any ideas as to what I am doing wrong?

Thanks in advance!
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
2 2535
hi

what error are you getting?

AT compile or runtime?

it should be enough to use TestForm.Show();

btw, TestNumber is an instance variable that you created previously right?
it not the name of the class ?

chgeers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"OutdoorGuy" <Ou********@fishing.com> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
Greetings,

I have a "newbie" question related to forms. I am attempting to use the
code below to open up another form when the user presses the "OK" button
(after making the appropriate selection from a combo box). However, I
am receiving an error at the following line of code:

TestNumber.ActiveForm.Show();

"TestNumber" is the name of the second form that I want to display. The
code for this routine is below:

private void btnOK_Click(object sender, System.EventArgs e)
{
string strChoice = this.cboChoice.Text;
switch (strChoice)
{
case "For Loop":
TestNumber.ActiveForm.Show(); <-- Error occurs here
break;
case "While Loop":
...
break;
}
}

Any ideas as to what I am doing wrong?

Thanks in advance!
*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #2

Hi. Thanks for the response. I finally got it working. I failed to
instantiate the form. Adding the code below resolved the issue.

TestNumber ForLoopForm = new TestNumber();
ForLoopForm.Show();

Thanks again.
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3

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

Similar topics

6
by: HartSA | last post by:
Here is the relevent part of my code. I am trying to learn ASP. <body> <table border="0" cellspacing="0" cellpadding="0"> <form name="frmSearch1a" method="get"> <tr> <td align=center>...
10
by: soup_or_power | last post by:
The pop up window has several checkboxes. I'm unable to access the checkboxes using the handle from window.open. Any way to do this? var display; function showSugg(but_id, sugg1, sugg2, sugg3,...
5
by: elieli_132 | last post by:
Hi, My problem is the following: Made changes to code in form and closed the form. Now unable to open / design the form. - Tried copying and pasting - the new one does not open /display....
3
by: Susan Bricker | last post by:
Greetings. I have three forms that are open at the same time. They are related and cascading. The first form (frmEventAdd) is the anchor. Each event can have many Trials. The second form is...
2
by: NG WEI CHUNG | last post by:
Hi, Some of my clients site is unable to view the ASP .NET page due to the proxy server and firewall or perhaps IE setting etc, I m not sure what is the actual cause of the problem, it display...
2
by: Paul Cheetham | last post by:
Hi, I have moved an application from VS2003 to VS2005, and I am now unable to view most of my forms in the designer. The majority of the forms in my project are derived from class PACForm,...
3
by: JeffDotNet | last post by:
I wrote a small data processing application that writes a summary of several hundred files. I use drag and drop on a panel (Panel1) to grab the absolute path to each of these files. Then I begin...
0
by: Nachi | last post by:
I have installed SQL Server 2000 with VS 2005 - did not install SqlExpress\Sql 2005. I have a remote Sql Server Instance locally. The normal application connectes to this Sql Server. When I run...
4
by: yawnmoth | last post by:
I'm trying to display a popup showing which radio button is selected and am unable to do so. Every time I try, I get undefined, instead of the value of the particular form variable I'm trying to...
1
by: Erik Lautier | last post by:
Hello, I'm using a multipart/form-data upload to put an image into SQL Server, and it appears to be working, but I'm unable to display the image. All I'm getting is the text of the URL we're on in...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.