Composite Control - Control sizing - DOTNET
This is a discussion on Composite Control - Control sizing - DOTNET ; I have created a fairly basic composite control consisting of a Label
and a TextBox. In the overridden Render function, I'm creating a
table with two rows and each row contains a cell (td). The Label and
the TextBox are ...
-
Composite Control - Control sizing
I have created a fairly basic composite control consisting of a Label
and a TextBox. In the overridden Render function, I'm creating a
table with two rows and each row contains a cell (td). The Label and
the TextBox are each rendered in one of the cells. Everything renders
fine. The problem is that depending on the column the control
represents I may want the textbox to be a different visible size
during both design and runtime. I exposed a public property of the
control to allow setting of the TextBox.Columns property but it does
not seem to have any effect.
Help would be appreciated.
-
Re: Composite Control - Control sizing
The Columns property of a TextBox sets the "size" HTML attribute of the
TextBox. This may be overridden by CSS styles. Other than that, I don't know
what you mean by "does not seem to have any effect."
--
HTH,
Kevin Spencer
Microsoft MVP
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"Eric" <asdf@a.com> wrote in message
news:uyOlNYI9HHA.396@TK2MSFTNGP06.phx.gbl...
>I have created a fairly basic composite control consisting of a Label
> and a TextBox. In the overridden Render function, I'm creating a
> table with two rows and each row contains a cell (td). The Label and
> the TextBox are each rendered in one of the cells. Everything renders
> fine. The problem is that depending on the column the control
> represents I may want the textbox to be a different visible size
> during both design and runtime. I exposed a public property of the
> control to allow setting of the TextBox.Columns property but it does
> not seem to have any effect.
>
> Help would be appreciated.
>
-
Re: Composite Control - Control sizing
Kevin,
Thanks for the reply. I guess what I'm looking for is the ability to
anchor the Label control and TextBox control to the composite control
container. If I resize the composite control, I would like the two
contained controls to re-size with it (at least the width). What I meant by
setting the Columns property of the TextBox has no effect is that changing
the value of the Columns property of the Textbox contained in the composite
control does not change its length.
<form id="form1" runat="server">
<div>
<asp:TextBox Columns="50" runat="server" ID="TB1"></asp:TextBox>
//expands the visible width of the TextBox
<abc:MyComposite TextBoxLength="50" runat="server"
ID="TB2"></abc:MyComposite>//In my composite control TextBoxLength changes
the Column value of the TextBox but it does not work
</div>
</form>
"Kevin Spencer" <unclechutney@nothinks.com> wrote in message
news:%23CcdaDS9HHA.1416@TK2MSFTNGP03.phx.gbl...
> The Columns property of a TextBox sets the "size" HTML attribute of the
> TextBox. This may be overridden by CSS styles. Other than that, I don't
> know what you mean by "does not seem to have any effect."
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
>
> DSI PrintManager, Miradyne Component Libraries:
> http://www.miradyne.net
>
> "Eric" <asdf@a.com> wrote in message
> news:uyOlNYI9HHA.396@TK2MSFTNGP06.phx.gbl...
>>I have created a fairly basic composite control consisting of a Label
>> and a TextBox. In the overridden Render function, I'm creating a
>> table with two rows and each row contains a cell (td). The Label and
>> the TextBox are each rendered in one of the cells. Everything renders
>> fine. The problem is that depending on the column the control
>> represents I may want the textbox to be a different visible size
>> during both design and runtime. I exposed a public property of the
>> control to allow setting of the TextBox.Columns property but it does
>> not seem to have any effect.
>>
>> Help would be appreciated.
>>
>
>
-
Re: Composite Control - Control sizing
The "size" attribute of an HTML text box(input type="text') is an HTML
attribute that sets the size (width) of the text box in characters. Can you
post the actual HTML generated for the composite control? That would yield
more information.
--
HTH,
Kevin Spencer
Microsoft MVP
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"eric" <7ak@!_df.com> wrote in message
news:uZZthcY9HHA.5164@TK2MSFTNGP05.phx.gbl...
> Kevin,
> Thanks for the reply. I guess what I'm looking for is the ability to
> anchor the Label control and TextBox control to the composite control
> container. If I resize the composite control, I would like the two
> contained controls to re-size with it (at least the width). What I meant
> by setting the Columns property of the TextBox has no effect is that
> changing the value of the Columns property of the Textbox contained in the
> composite control does not change its length.
>
> <form id="form1" runat="server">
> <div>
> <asp:TextBox Columns="50" runat="server" ID="TB1"></asp:TextBox>
> //expands the visible width of the TextBox
> <abc:MyComposite TextBoxLength="50" runat="server"
> ID="TB2"></abc:MyComposite>//In my composite control TextBoxLength changes
> the Column value of the TextBox but it does not work
> </div>
> </form>
>
>
> "Kevin Spencer" <unclechutney@nothinks.com> wrote in message
> news:%23CcdaDS9HHA.1416@TK2MSFTNGP03.phx.gbl...
>> The Columns property of a TextBox sets the "size" HTML attribute of the
>> TextBox. This may be overridden by CSS styles. Other than that, I don't
>> know what you mean by "does not seem to have any effect."
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>>
>> DSI PrintManager, Miradyne Component Libraries:
>> http://www.miradyne.net
>>
>> "Eric" <asdf@a.com> wrote in message
>> news:uyOlNYI9HHA.396@TK2MSFTNGP06.phx.gbl...
>>>I have created a fairly basic composite control consisting of a Label
>>> and a TextBox. In the overridden Render function, I'm creating a
>>> table with two rows and each row contains a cell (td). The Label and
>>> the TextBox are each rendered in one of the cells. Everything renders
>>> fine. The problem is that depending on the column the control
>>> represents I may want the textbox to be a different visible size
>>> during both design and runtime. I exposed a public property of the
>>> control to allow setting of the TextBox.Columns property but it does
>>> not seem to have any effect.
>>>
>>> Help would be appreciated.
>>>
>>
>>
>
>
Similar Threads
-
By Application Development in forum CSharp
Replies: 6
Last Post: 11-21-2007, 02:06 PM
-
By Application Development in forum CSharp
Replies: 1
Last Post: 11-15-2007, 03:12 AM
-
By Application Development in forum DOTNET
Replies: 0
Last Post: 10-31-2007, 04:44 AM
-
By Application Development in forum basic.visual
Replies: 7
Last Post: 03-14-2007, 07:14 PM
-
By Application Development in forum Inetserver
Replies: 1
Last Post: 11-10-2004, 08:23 AM