CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    114

    label runtime width

    I am trying to set width of labels at runtime.

    I tried lablel1.width=Unit.Pixel(50);

    and

    label1.width=Unit.Point(50);

    I even tried lable.controlstyle.width, but nothing seems to work for me .at runtime the width of the label seems to get truncated.can anyone tell me how it can be done successfully.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto
    Posts
    805

    Re: label runtime width

    have you tried just
    Code:
    this.label1.width = 50;
    hth,
    mcm
    rate my posts!
    mcm

  3. #3
    Join Date
    Mar 2004
    Posts
    114

    Re: label runtime width

    Yes i did,nothing worked

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto
    Posts
    805

    Re: label runtime width

    are you sure your actually modifing the right label? is there a label on the page with the id "label1"? Or are you creating it from code? If it IS on the page already when you type
    "this.label1" does the auto-complete and code hinting box come up with the available properties for a label object? Perhaps your just setting the width of a reference to a label, not an actual label itself.

    hth,
    mcm
    rate my posts!
    mcm

  5. #5
    Join Date
    Mar 2004
    Posts
    114

    Re: label runtime width

    its a pretty complecated thing i am doing.its a sharepoint 2007 site.i am developing a webpart through class library project.there i am creating labels at runtime.everything works, except the label width.

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

Featured