Results 1 to 5 of 5

Thread: Creating Labels using code (resolved)

  1. #1

    Thread Starter
    Member andrew5578's Avatar
    Join Date
    Dec 2003
    Posts
    51

    Creating Labels using code (resolved)

    is there a way to create labels w/ specific names, specific borderstyles and specific text? if anyone knows how to do it in vb 5 and vb net especially that would be great!
    Last edited by andrew5578; Mar 2nd, 2004 at 08:52 PM.
    aka Ender

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    This example assumes that ONE Label already exists, and its Index is 0 (that is a requirment):
    VB Code:
    1. Load Label1(1)
    2.    
    3.     With Label1(1)
    4.         .Caption = "New Label"
    5.         .Width = 2000
    6.         .BorderStyle = 1
    7.         .Move 100, 300
    8.         .Visible = True
    9.     End With




    Bruce.

  3. #3

    Thread Starter
    Member andrew5578's Avatar
    Join Date
    Dec 2003
    Posts
    51
    thanks brucefox. lol uve helped me like 10 times!!!! thanks alot
    aka Ender

  4. #4
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    No probs

    There is a way to load them from scratch (ie no Control Array); there are few examples posted here.


    Edit:
    And to load multiple...
    VB Code:
    1. Load Label1(Label1.Count)
    2.    
    3.     With Label1(Label1.Count - 1)
    4.         .Caption = "Label " & Label1.Count
    5.         .Width = 2000
    6.         .BorderStyle = 1
    7.         .Move Label1(Label1.Count - 2).Left, Label1(Label1.Count - 2).Top + Label1(Label1.Count - 2).Height
    8.         .Visible = True
    9.     End With
    Last edited by Bruce Fox; Mar 2nd, 2004 at 09:07 PM.

  5. #5
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171


    Has someone helped you? Then you can Rate their helpful post.

Posting Permissions

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



Click Here to Expand Forum to Full Width