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

Showing a secondary form

I have a main form and then a secondary form that allows entry of some
settings. I want to show the secondary form modally (I guess using
..ShowDialog), but I'd like it shown against the background of the main
form. At present using frm2.showdialog eg from a main form menu click
causes the main form to disappear from the background, which is a
little disorientating for the user.

Is this the standard behaviour of ShowDialog or have I got a bug (like
a me.hide hidden away somewhere relating to the main form that I need
to hunt down) ?

JGD
Nov 21 '05 #1
6 1145
John,

Just set in your dialog form
\\\
frm.owner = me
///

And you should of course make than frm, something smaller otherwise it looks
strange.

The mainform should not disapear when the dialog form is smaller, when it
does, than show us some code you are using.

With the showdialog is as far as I know only a bug with the behaviour of the
standard form buttons and not in this case.

I hope this helps?

Cor

"John Dann" <ne**@prodata.co.uk>
I have a main form and then a secondary form that allows entry of some
settings. I want to show the secondary form modally (I guess using
.ShowDialog), but I'd like it shown against the background of the main
form. At present using frm2.showdialog eg from a main form menu click
causes the main form to disappear from the background, which is a
little disorientating for the user.

Is this the standard behaviour of ShowDialog or have I got a bug (like
a me.hide hidden away somewhere relating to the main form that I need
to hunt down) ?

JGD

Nov 21 '05 #2
Your main form should not be disappearing w/o you having coded it to do so.

Greg

"John Dann" <ne**@prodata.co.uk> wrote in message
news:rj********************************@4ax.com...
I have a main form and then a secondary form that allows entry of some
settings. I want to show the secondary form modally (I guess using
.ShowDialog), but I'd like it shown against the background of the main
form. At present using frm2.showdialog eg from a main form menu click
causes the main form to disappear from the background, which is a
little disorientating for the user.

Is this the standard behaviour of ShowDialog or have I got a bug (like
a me.hide hidden away somewhere relating to the main form that I need
to hunt down) ?

JGD

Nov 21 '05 #3
On Sat, 1 Jan 2005 19:20:38 +0100, "Cor Ligthert"
<no************@planet.nl> wrote:
Just set in your dialog form
\\\
frm.owner = me
///


OK thanks. Is there any reason not to say:

frm.showdialog(Me)

(Which I've just discovered with your prompting and which seems to
work equally well)

JGD
Nov 21 '05 #4
John,

There is in my opinion never a reason not to use something, that is the
poweer of dotnet, there is not a best way, there are maybe ways to avoid.

Just my thought,

Cor
Nov 21 '05 #5
"John Dann" <ne**@prodata.co.uk> schrieb:
I have a main form and then a secondary form that allows entry of some
settings. I want to show the secondary form modally (I guess using
.ShowDialog), but I'd like it shown against the background of the main
form. At present using frm2.showdialog eg from a main form menu click
causes the main form to disappear from the background, which is a
little disorientating for the user.

Is this the standard behaviour of ShowDialog or have I got a bug (like
a me.hide hidden away somewhere relating to the main form that I need
to hunt down) ?


Normally, showing a form modally does not /hide/ the form it's shown on.
Can you post the code you are using to show the 2nd form?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #6
On Sat, 1 Jan 2005 19:46:24 +0100, "Herfried K. Wagner [MVP]"
<hi***************@gmx.at> wrote:
Normally, showing a form modally does not /hide/ the form it's shown on.
That's what I thought.
Can you post the code you are using to show the 2nd form?


Well I would but it's fairly straightforward and innocuous. But more
to the point, now that I've gone back and taken out the owner
reference as a test, the main form isn't disappearing any more! But
I'd swear it was happening every time before. So something's obviously
changed but it's probably not worth taking anyone's time in
speculating or investigating what it might have been. Just hope it
doesn't happen again!

Thanks everyone anyway.

JGD
Nov 21 '05 #7

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

Similar topics

4
by: R.G. Vervoort | last post by:
Does anyone have a suggestion how I can order a list with names in a secondary select string. The first string selects a number of locations where people work From this string I get...
7
by: hank | last post by:
Hi All In the Circular Logging when the Primary Log file fill up, the database manager will creat a secondary log files for the transaction; when this transaction finished, the secondary log...
2
by: BG | last post by:
We're having trouble writing the code to update a UI control (label.Text) from a secondary thread. We're using C# with Windows Forms. We have a main form named MainForm, a splash screen form...
3
by: Wilfried Mestdagh | last post by:
Hi, I'm trying to move a secondary form to the main form's center. But this does not work with the code I try. Can someone explain ? Form1 is my seond form. And this is menu item click from...
1
by: kurotsuke | last post by:
Hi, I need to show a form from a secondary thread and I'm using the Invoke method to call the delegate on my form. I would like to display the form and issuing the command from the secondary...
3
by: Dale Lundgren | last post by:
I have a c# class library that launches a Win Form in a secondary thread. From the Form (now running in the secondary thread) I need to be able to start a method that is defined in the class and...
4
by: Zorpiedoman | last post by:
In a multi-monitor environment, a form I am creating at run time keeps placing itself on the primary screen, even if the main form of the program making the call is on the secondary screen. How...
4
by: mmeldrum | last post by:
Hoping someone can help me out here. I have a form which performs calcualtions in it. The form was build using a table with the exact same fields. I placed the one expression in the actual field...
4
by: Ed Bitzer | last post by:
Appreciate some direction as to what most of you professionals do when passing some limited variables to another form. A simple example would be passing the location of a second form. I could use...
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
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: 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
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:
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.