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. Web Development
  3. ASP.NET
  4. What is the datatype of a control's width property?

What is the datatype of a control's width property?

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-nethelp
4 Posts 4 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.
  • K Offline
    K Offline
    KaKa
    wrote on last edited by
    #1

    Hello, What is the data type returned from an asp.net control's Width property? I tried performing arithematic operations on it but asp.net(vb) recognised it as a syntax error. private int test label1.width = Me.width * (test/100) 'vb highlighted this as an error How do we perform arithematic on the width properties?

    B R I 3 Replies Last reply
    0
    • K KaKa

      Hello, What is the data type returned from an asp.net control's Width property? I tried performing arithematic operations on it but asp.net(vb) recognised it as a syntax error. private int test label1.width = Me.width * (test/100) 'vb highlighted this as an error How do we perform arithematic on the width properties?

      B Offline
      B Offline
      benqazou
      wrote on last edited by
      #2

      Hey, Clearly the width property is always an integer. The problem (I guess) in your code is that Me.width * (test/100) is not always an integer (eg. test = 3.. or so) But a float.. And C# (or VB.Net) does not convert (or cast) implicitly an integer into a float or decimal.. Just try this : label1.width =(int) Me.width * (test/100) //C# not VB Good luck.

      1 Reply Last reply
      0
      • K KaKa

        Hello, What is the data type returned from an asp.net control's Width property? I tried performing arithematic operations on it but asp.net(vb) recognised it as a syntax error. private int test label1.width = Me.width * (test/100) 'vb highlighted this as an error How do we perform arithematic on the width properties?

        R Offline
        R Offline
        RichardGrimmer
        wrote on last edited by
        #3

        Isn't it something like a System.Forms.Size? (Or perhaps Unit - that rings bells) "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

        1 Reply Last reply
        0
        • K KaKa

          Hello, What is the data type returned from an asp.net control's Width property? I tried performing arithematic operations on it but asp.net(vb) recognised it as a syntax error. private int test label1.width = Me.width * (test/100) 'vb highlighted this as an error How do we perform arithematic on the width properties?

          I Offline
          I Offline
          Ista
          wrote on last edited by
          #4

          To set the size use the Unit class To set the size of a font use the FontUnit class Its stored as a size structure The integer is available as read only you can't directly change it 1 line of code equals many bugs. So don't write any!! -- modified at 12:06 Thursday 30th March, 2006

          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