Results 1 to 9 of 9
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Background (VB 6.0 / W98)

    What's the best way to set a neutral background behind the forms in a VB application? (In other words to replace the desktop with a blank screen while running the VB application.) I suppose one could open a blank maximized form on top of which you run all your other forms or is there a better way?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Background (VB 6.0 / W98)

    I don't know if creating a maximized blank form will help. You'd have to open all your other forms as modal so that users can't activate the blank form. I don't know whether that is possible in your application. Also, users might be irritated that they can't see the desktop.

    You might consider creating an MDI (Multiple Document Interface) application that has one parent (main) window and multiple child windows displayed within the parent window. For example Access, Excel, and for that matter VB6 itself, are MDI applications.

    Be aware, though, that designing an MDI application is more complicated than designing an SDI (Single Document Interface) application.

    The first steps are creating a parent form (Project/Add MDI Form) and setting the MDIChild property to True for each child form.

    You can look up "MDI applications" in the online help.

    VB6 also comes with a sample MDI application. In my installation, it is in the folder
    C:Program FilesMicrosoft Visual StudioMSDN9898VSa1033SAMPLESVB98MDI

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Background (VB 6.0 / W98)

    That's the usual way to do it. Ordinarily, you put your menus on that maximized form and pop up your other forms in front of it.
    Charlotte

  4. #4
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Background (VB 6.0 / W98)

    Hi Charlotte,

    Your suggestion was actually my first solution. The only problem was that I couldn't find a way to move my menu to the center of the screen. It always appeared near the upper left corner. I tried changing the Left and Top properties of the form, but that didn't seem to have any effect. If you have a suggestion I would welcome it.

  5. #5
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Background (VB 6.0 / W98)

    Hi Hans,

    However, being a rank beginner in VB I don't think I'll attempt it, as I'm having enough problems already.

    Thanks,

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Background (VB 6.0 / W98)

    It isn't Windows "normal" to have your menus in the center of the screen or centered at the top. Windows apps typically put the menu at the upper left corner of the application window. Normally, the menu you display stays visible, even when other forms are open. If you're trying for a switchboard, you would do that differently.
    Charlotte

  7. #7
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Background (VB 6.0 / W98)

    Hi Charlotte,

    I suppose that what I am attempting is more like a switchboard. However, it works OK by simply maximizing the initial window that functions like a switchboard.

    Thanks for your advice.

  8. #8
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Background (VB 6.0 / W98)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Chuck

    I don't know what I am writing here, but I was at the MSKB and I found something called: SetForegroundWindow32

    Declare Function SetForegroundWindow32 Lib "user32" Alias "SetForegroundWindow" (ByVal hwnd As Long) As Long

    Try this one, and see what it does.

    Wassim <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  9. #9
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Background (VB 6.0 / W98)

    Thanks Wassim,

    I'll have to give it a look.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •