Click to See Complete Forum and Search --> : What datatype is returned from a control's width property?


ZhiYi
March 29th, 2006, 04:22 AM
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?

Shuja Ali
March 29th, 2006, 04:29 AM
Width is an Integer data type, When you perform this calculation it returns a double so you should convert it to Integer using this code
label1.width = Convert.ToInt32(Me.width * (test/100) )