Ralf Meier Jul am. I think the inquirer is experimenting with the possibilities. This question matches to other questions which are asked before which perhaps lead to the same goal But your explaining is very good Thanks, Ralf! I have not read the OP's other posts. It is the same thing as in every of your other questions.
You create a new your own baseform which has this overrided methods in it and every Form you want to use, which should have this behaviour, MUST derive from this baseform instead of using "Windows.
The problem is not form's, you fixed that problem with your first answer, the problem is with the buttoms placed on usercontrols. I cannot find a way to give them the functionality that i want. That sounds like a different question to me. For me too. But, if I don't fixed your problem with my suggestions until now Please describe it and I am sure that we will find a solution - perhaps together.
But I must repeat my question in your other question : have you tried the modified code-snipped from me and doesn't it solve your problem? If No - what should happen exactly? It works the same on forms but not on usercontrols. How about adding a special functionality to my baseusercontrol which help my usercontrols work. In the other question from you I modified the Handler-Script in that way that in the Messagebox every Parent of a Control is displayed.
If you want to modify this Method you should cut it out of the Designer-Script and insert it in the UserControl-Script. Now you could add severall code-lines to it. Thanks for this good explanation. I read it hours after I could fix my problem. Ralf Meier Jul pm. You gave the respond to me and not to Bill who should get this respond. If you want that Bill sees it you should reply to one of his comments I think, he would be glad too So, which one is typically used and why? Refracted Paladin Refracted Paladin Add a comment.
Active Oldest Votes. You only need OnLoad if: You need to know the exact size and position of the window. OnLoad is best, the window Handle is created and the user preferences are applied title and border size and the form was rescaled as directed by the Form.
AutoScaleMode property. The window is not yet visible, a very good time to move the window somewhere else or to arrange the child controls.
You have code that needs the Handle property. This is subtle, you cannot always tell. Having code like that in the constructor is unhealthy, the window gets created before the constructor completed. It usually comes to a good end but it can make creating the form very slow. Easy to diagnose from the Call Stack window. To avoid a bug in the MDI implementation. If you create an MDI child in the parent constructor then you'll get duplicated glyphs, visible when you maximize the child.
Create the child in OnLoad instead. Hans Passant Hans Passant k gold badges silver badges bronze badges. So, stop me if I am wrong, but it is more "correct" to use the OnLoad but I would need to be cognizant of the fact that the code in there would not be available to another class. It is available to a derived class, base. Skipping the initialization of the base class would almost always be wrong. So if a derived class call OnLoad it would fire base.
OnLoad and then any code I put after that. A derived class never calls OnLoad, that's goes kaboom. Always base. I recommend you start your own thread.
Show 5 more comments. I would recommend overriding the method rather than subscribing to the event. Check to verify that you are inserting proper data into the database. One or more values being entered into the database are violating constraints. Windows Server Developer Center. Sign in.
United States English. Home Learn Downloads Community. Ask a question. Quick access. Search related threads. Remove From My Forums. Answered by:.
0コメント