Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 13th, 2006, 12:13 AM
Authorized User
 
Join Date: Mar 2004
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default Use form properties before .Show()

Hello again,

I was wondering if anyone knew how to use properties of a form before using the .Show() method, or possibly another way to fix my real problem.

Im developing a program which has one form as an mdiparent. In this form I have a method named SwitchForm that other child forms call.

Code:
    Public Sub SwitchForm(ByRef openerForm As Form, ByVal newForm As Form)
        openerForm.TopMost = True
        newForm.MdiParent = Me
        newForm.Show()
        newForm.Left = 0
        newForm.Top = 0
        openerForm.Close()
        openerForm.Dispose()
    End Sub
Basically what this method is used for is to open the new form I want to close the form that called the method and open the form designated using the mdiparent form as intermediate to not trick the taskbar into thinking its a new program (if you know what I mean). This works how I want it, however, the cascading (due to the mdi) is causing the new child form to move a little to the right and down from where the old form was.

Anything i've tried (after the .Show() method setting the left and top to 0, or docking the new form) causes a flicker type action).

I figured if I could set the left and top to 0 BEFORE the .Show() method, this would fix my flicker, however, it seems I can't set its properties before the .Show() method.

I also figured that if there was someway to have the old form top most and create the new form under, then set its properties then close the old form it would also fix my problem, but I cant seem to find a way to do this.

Anywho, does anyone have an idea of what possible solutions I could use?

Thanks in advance

 
Old February 13th, 2006, 05:03 PM
Authorized User
 
Join Date: Mar 2004
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Basically I want all new forms that open to be at the 0,0 position.






Similar Threads
Thread Thread Starter Forum Replies Last Post
remove form properties angelboy C# 2005 4 June 30th, 2007 01:23 PM
form properties angelboy C# 2005 2 April 13th, 2007 10:32 PM
How to handle control properties in a form Birger Excel VBA 8 January 28th, 2005 10:45 AM
How To Close One Form And Show Another form Israr VS.NET 2002/2003 1 December 7th, 2004 12:30 PM
Form Location Properties tlwaltz BOOK: Access 2003 VBA Programmer's Reference 0 August 21st, 2004 07:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.