Results 1 to 5 of 5

Thread: center a label with code in webform [Resolved]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Location
    Savannah, GA
    Posts
    100

    center a label with code in webform [Resolved]

    I am trying to center a label in code on a webform in a webapplication. I tried using the code

    VB Code:
    1. label1.left = (Me.width/2)-(label1.width/2)

    and realized later that the left and top properties don't exist when building a web application. I am new to building web apps and was wondering if there was another method to center controls in code, possibly using HTML Tags? If so where would I put the tags to make it work, I know little to nothing about HTML. Any help is appreciated. Thanks.
    Last edited by ERage; Jan 14th, 2004 at 04:51 PM.

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    You can do this:
    Code:
    <p align="center">...your label here....</p>
    Or you can do this:

    Code:
    <div align="center">...your label here....</div>
    There are many others, you need to get a book on html, as that is some of the easiest stuff there is.

  3. #3
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271
    or even...

    <center> Label here </center>
    §tudz

    Studzworld.com - Portfolio

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Originally posted by §tudz
    or even...

    <center> Label here </center>
    but I think the newer standards are getting rid of it...., but is definately still usable right now.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Location
    Savannah, GA
    Posts
    100
    Thanks, I had a feeling that it just required a little HTML. I was just curious if there might have been a way to position controls using the vb code but I guess really doesn't make much sense on a web form after I thought about it. Thanks again for the replys.

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