473,473 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

using the show command

Hello!

When I have only one window how can the window form be displayed
when I don't have a show method. As in the example below with the Form class
FrmContainer

If I have an MDI child I must explicitly use the Show method for the MDI
child.

Can somebody explain that!
Is it possible to write some code which confirm that the show method is
called.
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fals e);
Application.Run(new FrmContainer());
}

public FrmContainer()
{
InitializeComponent();
}
//Tony
Jun 28 '08 #1
3 1290
On Sat, 28 Jun 2008 11:03:28 -0700, Tony Johansson
<jo*****************@telia.comwrote:
When I have only one window how can the window form be displayed
when I don't have a show method. As in the example below with the Form
class
FrmContainer [...]
I believe someone already answered this same question in a different
thread.

Pete
Jun 28 '08 #2
Hello!

The answer in another thread said the following.

"Application.Run calls Show
do this, redefine the Show method in your form and put a breakpoint
there, take a look in the call stack and you will see the call"
I redefined this Show in the following way
public new void Show()
{
...
}

I put a breakpoint on this redefined Show but there was no call to this
method

//Tony

"Peter Duniho" <Np*********@nnowslpianmk.comskrev i meddelandet
news:op***************@petes-computer.local...
On Sat, 28 Jun 2008 11:03:28 -0700, Tony Johansson
<jo*****************@telia.comwrote:
>When I have only one window how can the window form be displayed
when I don't have a show method. As in the example below with the Form
class
FrmContainer [...]

I believe someone already answered this same question in a different
thread.

Pete

Jun 29 '08 #3
On Sun, 29 Jun 2008 02:18:59 -0700, Tony Johansson
<jo*****************@telia.comwrote:
[...]
I redefined this Show in the following way
public new void Show()
{
...
}

I put a breakpoint on this redefined Show but there was no call to this
method
I admit, the term "redefine" is ambiguous. The person who wrote that to
you could have been more careful with his words. But what made you think
that hiding the base class Show() would accomplish what you wanted?

The short answer is that Show() is called implicitly when
Application.Run() is called. More generally, when you are writing new
versions of a virtual method, you practically always want to "override"
rather than "new".

Pete
Jun 30 '08 #4

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

Similar topics

1
by: seeni | last post by:
I have tried to add a new command for a visual studio add-in. This command should be added when the user loads any solution into the IDE(not at startup). The command should disappears when the user...
4
by: Kartik | last post by:
Hi, I have an ASP.NET application using VB.NET.I am sending a DOS command to a machine on the network to print a file. This is achieved using xp_cmdshell Dim str As String = "xp_cmdshell...
19
by: bdt513 | last post by:
I am trying to extract the values from a query using VBA. Specifically, I want to concatenate all the values of the "rosEmail" field from query "qselRosterEmailList" into one string (strEmails). I...
2
by: Sharon | last post by:
I have a Form class that can be open by parent Form or by .NET Remoting command. When the parent Form opens the Form - All fine ! But when the .NET Remoting command is trying to Show the Form, the...
5
by: Gene | last post by:
What can I do if I want to get the result using the sql command? for example, the select command is "select Name from Employee where StaffID=10" How to get the "Name"??? dim Name as string and...
1
by: Anonieko | last post by:
Understanding and Using Exceptions (this is a really long post...only read it if you (a) don't know what try/catch is OR (b) actually write catch(Exception ex) or catch{ }) The first thing I...
3
by: aldonnelley | last post by:
Hi all. Just having a weird problem with tkinter. I'm trying to make a gui that shows results from an image search, with a "forward" and "back" button so the user can compare results from...
7
by: Wiebe Tijsma | last post by:
Hi, I'm using C# + webDAV to create a draft message to be sent in a user's Drafts folder. I can create the message successfully, however when I open the message in outlook, it doesn't show...
7
by: bryant | last post by:
Hi all. I am new to ASP and working in Expression Web. The following query displays the information I need in the gridview for a single record. SELECT "OE_HDR"."ORD_NO", "OE_HDR"."CUST_NAM",...
5
by: Ishmael | last post by:
Hi Is Been a 3 Yrs Now (I Still trying to do this) Please help me to do this with Visual Basic 6.0 using Msflexgrid Let say you are the Principal . You have 10 educators and 5 class (Grades)...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.