|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Custom Control at deisgn timeI 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 > // Setup the controls on the page. Still thinking on other parts... but probably:> btnImage = new System.Web.UI.WebControls.ImageButton(); > btnImage.ImageAlign = ImageAlign.Top & ImageAlign.Left; ImageAling = ImageAling.Top | ImageAlign.Left; (bitwise OR and not bitwise AND should be the case) -- Happy Hacking, Gaurav Vaish | http://www.mastergaurav.com http://www.edujinionline.com http://articles.edujinionline.com/webservices ------------------- 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 Gaurav Vaish (www.EduJiniOnline.com) wrote: Show quoteHide quote >> // Setup the controls on the page. >> btnImage = new System.Web.UI.WebControls.ImageButton(); >> btnImage.ImageAlign = ImageAlign.Top & ImageAlign.Left; > > Still thinking on other parts... but probably: > > ImageAling = ImageAling.Top | ImageAlign.Left; > > (bitwise OR and not bitwise AND should be the case) > >
Uploading big files
GridView Nested - Is it Possible? missing ellipsis in editor Can't repopulate DropdownList control during postback? Query on user control How to use Socket Connection Getting multi values from a list box Div background image from CSS Role of the web.config file with UserControls [2.0] Equivalant to the DateTimePicker |
|||||||||||||||||||||||