Last post Apr 24, 2009 11:46 PM by b471code3
Apr 24, 2009 06:22 PM|veudain|LINK
I have created a web server control that contains a textbox and two image buttons. The images are a fixed size (in pixels). I would like to have the textbox fill the entire controls width minus the size of the images. This is not a problem if the unit
type passed in is not a percentage; however, I cannot figure out how to set the width of my textbox when a percentage is passed to the control.
For example, if each image is 20 pixels wide and the width property is set to 100%, how do I set my textbox width to 100% - 40 pixels.
Any help would be great.
Apr 24, 2009 11:46 PM|b471code3|LINK
Since it is a custom control you have to create a property for that width to have access to it on the front side. Like this:
Public Property TextBoxWidth() As Drawing.Size
Set(ByVal value As Drawing.Size)
TextBox1.Size = value