[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Hak

1/7/2003 5:50:00 PM

Hi

I am creating a composite controls that consists of an
image, textbox, and required field validator.

To do this, I added a panel and placed above three
controls on the panel.

This composite controls is inherited from webcontrol and
I made a shadow property Width and Height to control the
size of this control at design and run time.

However, I cannot resize the controls and also if I
change it and run the control I am getting "Ambigious
match found" error. When I take a look at the source
code, the Width of the control is added as an attribute
instead of being one of the Sytle.

How can I add the width as a style and be able to resize
the control at design and run time???

Thank you
Hak





3 Answers

Jesse Ezell

1/7/2003 8:35:00 PM

0

Width and Height are already members of the class because
you are inheriting from WebControl, you shouldn't add
them manually.

--Jesse

Hak

1/7/2003 10:42:00 PM

0

Thank you Jesse for the prompt response.

However, I would like to clarify what I intend to do.
I want to create a custom text control. With an image and
a required field validator. The image will notify the
user whether the text box is required or not visually.
And the validator will validate the condition.

The image will be on top of the textbox. Means the
control is in fact just a Textbox. (with enhancement)

And I want to be able to modify the width of the control
by Width Property as normally other controls's Width
property do. It will expand or shrink the textbox as well
as the composite control.

Right now, if I don't overries or shadow the Width
property and modify the value it expand or shrink the
control but leave the textbox unchanged.

In other words, how can I make the textbox's width same
as the custom control's width?

Thank you
Hak

>-----Original Message-----
>Width and Height are already members of the class
because
>you are inheriting from WebControl, you shouldn't add
>them manually.
>
>--Jesse
>.
>

Patrick Verbeeten

1/7/2003 11:01:00 PM

0

Instead of shadowing the width and height try overriding them
this way you can set the height and width of the controls from
there.



"Hak" <hak-kyoo.kim@ServTrac.net> wrote in message
news:100101c2b695$bad5a0a0$d7f82ecf@TK2MSFTNGXA14...
> Thank you Jesse for the prompt response.
>
> However, I would like to clarify what I intend to do.
> I want to create a custom text control. With an image and
> a required field validator. The image will notify the
> user whether the text box is required or not visually.
> And the validator will validate the condition.
>
> The image will be on top of the textbox. Means the
> control is in fact just a Textbox. (with enhancement)
>
> And I want to be able to modify the width of the control
> by Width Property as normally other controls's Width
> property do. It will expand or shrink the textbox as well
> as the composite control.
>
> Right now, if I don't overries or shadow the Width
> property and modify the value it expand or shrink the
> control but leave the textbox unchanged.
>
> In other words, how can I make the textbox's width same
> as the custom control's width?
>
> Thank you
> Hak
>
> >-----Original Message-----
> >Width and Height are already members of the class
> because
> >you are inheriting from WebControl, you shouldn't add
> >them manually.
> >
> >--Jesse
> >.
> >