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 can I create a top most form?

how can I create a top most form?

Scheduled Pinned Locked Moved Visual Basic
question
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.
  • S Offline
    S Offline
    smartnose
    wrote on last edited by
    #1

    Which attribute should I set? Thanks

    A D 2 Replies Last reply
    0
    • S smartnose

      Which attribute should I set? Thanks

      A Offline
      A Offline
      Andy H
      wrote on last edited by
      #2

      The following will ensure the form is kept on top: Option Explicit Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, _ ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Const HWND_TOPMOST = -1 Const SWP_SHOWWINDOW = &H40 Const SWP_DRAWFRAME = &H20 Private Sub Form_Load() Dim retval As Long retval = SetWindowPos(Me.hwnd, HWND_TOPMOST, 100, 100, 100, 100, SWP_DRAWFRAME Or SWP_SHOWWINDOW) End Sub

      1 Reply Last reply
      0
      • S smartnose

        Which attribute should I set? Thanks

        D Offline
        D Offline
        Daniel Turini
        wrote on last edited by
        #3

        In VB.NET, set the TopMost property to True. In VB6, search MSDN for Q184297 lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik

        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