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. Newbie: want to create instance of line control at run time through code

Newbie: want to create instance of line control at run time through code

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

    HI guys its me again I'm really stuck and I need the help. I want to create an instance of the line control on my form at run time. But some how the following code doesn't work DIm line1 as Line Set line1 = New Line 'setting line properties line1.visible = true I really need to knwo how to do this and I don't want to use any drawline functions as I don't want to draw a bitmap just want to be able to create an instance of the line control. I really need the help I'm using vb6

    D 1 Reply Last reply
    0
    • G gamerPotatoe

      HI guys its me again I'm really stuck and I need the help. I want to create an instance of the line control on my form at run time. But some how the following code doesn't work DIm line1 as Line Set line1 = New Line 'setting line properties line1.visible = true I really need to knwo how to do this and I don't want to use any drawline functions as I don't want to draw a bitmap just want to be able to create an instance of the line control. I really need the help I'm using vb6

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You probably didn't add the new Line control to the Controls collection of the object onto which your drawing. For instance, if your drawing on the surface of a Form (not a picture box!), you would have to add the control to the Controls collection of the Form:

      Dim WithEvents myLine As Line
      Set myLine = Form1.Controls.Add("VB.Line", "myLineControl")
      myLine.Visible = True

      The VB.Line might be a bit different. Check in the Object Browser (F2) to see what the exact name of the control is if not VB.Line. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      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