473,322 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

User control: when are all properties loaded?

3
Hi guys and gals!

I'm writting a simple user control and I need to conditionally set the size of it at control load time.

I have coded that into the constructor. It runs but the changes are not displayed on the screen (on the form at run time). At this time the parent property of the control is null. At what point (ie is there a handy event) are the properties BOTH standard and my custom ones all loaded up?

I need access to the design time porperties to decide on the visual setup of the control.

I'd be really gratefull for a steer in the right direction.

Here's the code:

Expand|Select|Wrap|Line Numbers
  1. public DrawerControl()
  2. {
  3. InitializeComponent();
  4. ToggleState(pbStartOpen);
  5. }
  6.  
  7. private void ToggleState(bool bOpen)
  8. {
  9.  
  10. if (bOpen == false)
  11. {
  12. // close up
  13. this.Height = (cmdOpenShut.Height + 6);
  14. cmdOpenShut.Text = psClosedCaption;
  15. }
  16. else
  17. {
  18. // open up
  19. this.Height = piToolFrameHeight;
  20. cmdOpenShut.Text = psOpenCaption;
  21. }
  22. }
Mar 2 '07 #1
0 939

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage...
4
by: oneeye | last post by:
Hello All, I have designed and built a web control that loads a user control at run time. The question I have is, can I Load the user control in design view? Any Ideas or code snippets would be...
1
by: Josh | last post by:
Hi Guys, I have been having a big problem with trying to pass parameters into a user control when the user control is dynamically loaded into a placholder. I am developing in c#. I have get...
3
by: Matej Kavèiè | last post by:
Hello, i have one problem. I use loadcontrol in default.aspx page. On page i have placeholder and on load i with loadcontral load dynamic some user control. Some times i must load same user...
2
by: Alan Silver | last post by:
Hello, I'm having rather a problem with user control. It is a fairly simple affair (see my other threads for more details) that shows a date and time in five drop down controls. I had private...
7
by: Smithers | last post by:
I have a non trivial ASP.NET Web application that implements its navigation system via a user control (menu.ascx) placed on every page. It is important to note that the user control that hosts...
5
by: serge calderara | last post by:
Dear all, I try to study Web user control .For that I have created a simple text box with button as a webuser control which has 2 properties. Then I drop my user control on a web page for...
8
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
6
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.