Custom Control at deisgn time

P

Paul Cheetham

Hi,

I have a custom control, which creates 2 child controls - an ImageButton
and an image as shown in the following code:


// Setup the controls on the page.
btnImage = new System.Web.UI.WebControls.ImageButton();
btnImage.ImageAlign = ImageAlign.Top & ImageAlign.Left;

btnDisableImage = new System.Web.UI.WebControls.Image();
btnDisableImage.ImageUrl = DisableImageURLFromViewState;
btnDisableImage.Visible = false;



When this is displayed at design time, if I change the position of the
control (by changing the left and top attributes of the Style property)
then I get a rectangle drawn at the specified coordinates, and the image
button is drawn at double to specified corodinates.

So if I set the position to 100, 100, I get a rectangle drawn at that
point, and then the image is displayed at 200, 200

It looks like the style I set for the container control then also gets
applied to its child controls!


Is there a way around this?


I'm new to Custom Controls, so maybe I've missed something.

I'm developing it in VS2005, c#


Thankyou.


Paul
 
P

Paul Cheetham

Thanks for the reply.

That's a line I wrote in a hurry trying to fix the problem.
Unfortunately correcting it as you suggest doesn't make any difference.

Thanks again


Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top