Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to make a form on the top of all forms?

How to make a form on the top of all forms?

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MJay
    wrote on last edited by
    #1

    as topic, if i have form1 and form2, form1 active form2 by using form2.show how to make form2 on the top of form1 which make user cannot click on form1? i used form2.topmost = True, although form2 is on the top of form1 but user still can click on form1 which make form1 become the active form and form2 become inactive wat i require is user must close form2 first b4 they can clickon form1 how am i going to do that?anyone can help? any help is greatly appreciated....

    A 1 Reply Last reply
    0
    • M MJay

      as topic, if i have form1 and form2, form1 active form2 by using form2.show how to make form2 on the top of form1 which make user cannot click on form1? i used form2.topmost = True, although form2 is on the top of form1 but user still can click on form1 which make form1 become the active form and form2 become inactive wat i require is user must close form2 first b4 they can clickon form1 how am i going to do that?anyone can help? any help is greatly appreciated....

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      when you are showing the form2 just say form2.show vbmodal. then the user cannot click form1:)

      Z 1 Reply Last reply
      0
      • A Anonymous

        when you are showing the form2 just say form2.show vbmodal. then the user cannot click form1:)

        Z Offline
        Z Offline
        Zipadie Doodah
        wrote on last edited by
        #3

        If you want to use the form as an information area, you can also try the following: '//////////////////////////////////////////////// '// StayOnTop '// '// This subroutine will force the form to stay '// at the topmost level. '// '// entry: flgActivate enable OnTop TRUE '// disable OnTop FALSE '//////////////////////////////////////////////// Private Sub StayOnTop(flgActivate As Boolean) Dim SetWinOnTop As Long Dim myFlag As Integer If flgActivate Then myFlag = HWND_TOPMOST ' Make this the topmost window Else myFlag = HWND_NOTOPMOST End If SetWinOnTop = SetWindowPos(Form3.hWnd, myFlag, 0, 0, 0, 0, &H1) End Sub

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups