4 Replies - 9109 Views - Last Post: 02 June 2011 - 09:52 AM Rate Topic: -----

#1 VisualStudio2010   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 05-November 10

How Do You Open A Form and Bring the Form to the Front AS Default?

Posted 01 June 2011 - 04:28 PM

I'm in trouble. I've been looking all over the internet, and I couldn't find any decent answers. Obviously, two things to know:

1) I'm using VB.
2) The Forms are all FULL SCREEN, with the code
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        Me.WindowState = FormWindowState.Maximized
        Me.TopMost = True

...

Anyway, I'm making a fake "operating system", and after you log in, there is like a desktop. You can initiate a program, and this is where I am having trouble. I want the program to look like it's in the operating system, and so the 'desktop' form is like a background. the Background/Desktop form is FULL SCREEN, and obviously ALWAYS OPEN and NEVER MINIMIZES. When I launch a form up with
 frmNameHere.Show() 
, it doesn't appear because

1) It's fullscreen
2) It's behind the form.

If anybody can give me advice/help on this, that would be VERY appreciated.

Thanks,
VisualStudio2010

Is This A Good Question/Topic? 0
  • +

Replies To: How Do You Open A Form and Bring the Form to the Front AS Default?

#2 smohd   User is offline

  • Critical Section
  • member icon


Reputation: 1825
  • View blog
  • Posts: 4,627
  • Joined: 14-March 10

Re: How Do You Open A Form and Bring the Form to the Front AS Default?

Posted 01 June 2011 - 04:50 PM

Yap no form will be above it since you set topMost property to true. What you have to do is to make your main form as an MDI form and all other forms as child form of it. Have a look about MDI parents and child form at:
Working with MDI applications
Working with MDI forms(parent & child)
Form.IsMDIContainer property
Was This Post Helpful? 0
  • +
  • -

#3 jhayton   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 28-May 11

Re: How Do You Open A Form and Bring the Form to the Front AS Default?

Posted 01 June 2011 - 06:15 PM

Or...if an MDI (Multiple Document Interface) Project isnt what you want, using a series of checks to make a form topmost or not..

FormName.TopMost = True
FormName.TopMost = False



Depending on the amount of forums you have...this may get messy and confusing.
Was This Post Helpful? 0
  • +
  • -

#4 _HAWK_   User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1162
  • View blog
  • Posts: 4,444
  • Joined: 02-July 08

Re: How Do You Open A Form and Bring the Form to the Front AS Default?

Posted 01 June 2011 - 08:58 PM

The only way to achieve what your asking is by calling some API's and set a panel as the application's parent. You will need SetParent, SetWindowsPos, FindWindow and poss Movewindow. This will not be easy as some application will not move into the panel.
Was This Post Helpful? 0
  • +
  • -

#5 Psyguy   User is offline

  • D.I.C Regular
  • member icon

Reputation: 84
  • View blog
  • Posts: 366
  • Joined: 12-January 11

Re: How Do You Open A Form and Bring the Form to the Front AS Default?

Posted 02 June 2011 - 09:52 AM

Correct me if I am wrong, but if all he wants to do is make sure that the fakeOSform is on top of the desktop all he has to do is make sure that form covers the normal desktop. If it has no border and is maximized, then he can't click the normal desktop and the form will stay on top of it, with any applications that are opened automatically coming to the forefront.
Edit: What a terribly phrased answer. Let me fix that.

This post has been edited by Psyguy: 02 June 2011 - 09:55 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1