Results 1 to 4 of 4

Thread: Adding Controls at Runtime **SOLVED**

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Sgt-Peppa's Avatar
    Join Date
    Mar 2003
    Location
    Munich - Germany
    Posts
    476

    Adding Controls at Runtime **SOLVED**

    Hey all,

    I am adding some LinkedLabels to my Form at runtime.
    If I am adding a text to it:

    Code:
    LinkLabel myLabel = new LinkLabel();
    myLabel.Text=fileName;
    and next I want to set the width Object to exactly the length of the text, how would I do that?

    Code:
    myLabel.Width = myLabel.Text.Length;
    does not work, since text.length only returns the number of Characters contained in that string.

    Any help is appreciated,

    Thanks,

    Stephan
    Last edited by Sgt-Peppa; May 5th, 2004 at 10:25 AM.
    Keep Smiling - even if its hard
    Frankie Says Relax, wossname Says Yeah!
    wossname:--Currently I'm wearing a gimp suit and a parachute.
    C# - Base64 Blog

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