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 do you detect if VB is in design mode or run mode

How do you detect if VB is in design mode or run mode

Scheduled Pinned Locked Moved Visual Basic
designhelpquestion
2 Posts 2 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.
  • C Offline
    C Offline
    clintsinger
    wrote on last edited by
    #1

    Hi, I have a control that when it initializes in design mode it gives me an error. This is because the variable that it uses has not been initialized yet. I could just do error trapping but I would rather just detect if the program is running or if I am in design mode. Is there any way to do that? Thanks, Clint Singer

    D 1 Reply Last reply
    0
    • C clintsinger

      Hi, I have a control that when it initializes in design mode it gives me an error. This is because the variable that it uses has not been initialized yet. I could just do error trapping but I would rather just detect if the program is running or if I am in design mode. Is there any way to do that? Thanks, Clint Singer

      D Offline
      D Offline
      David Wengier
      wrote on last edited by
      #2

      There is a property you can check that tells you.

      If Ambient.UserMode Then
      'We are in Run mode
      Else
      'We are in Design mode
      End IF

      -- David Wengier Sonork ID: 100.14177 - Ch00k

      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