Diesel Posted September 18, 2005 Posted September 18, 2005 What do you do to make a control a fixed height (and/or width) at Design time? Control.SetStyle(ControlStyles.FixedHeight, true); does not work
Diesel Posted September 18, 2005 Author Posted September 18, 2005 Well, yes if I was referring to the design mode of the control, but I was referring to the design mode of the container control that you place the user control on...So No, that does not work.
*Experts* DiverDan Posted September 19, 2005 *Experts* Posted September 19, 2005 Is this for a custom control that you made or a standard VS control? Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Diesel Posted September 19, 2005 Author Posted September 19, 2005 A usercontrol. Why...How would you make 'a standard VS control' not resizable?
*Experts* DiverDan Posted September 19, 2005 *Experts* Posted September 19, 2005 That's the point, you can't control a standard VS control. But since you've got a user control then open the "Windows Form Designer generated code" region and in the New Sub set your contol's default size along with any other defaults you might need. Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call SetStyle(ControlStyles.AllPaintingInWmPaint, True) SetStyle(ControlStyles.DoubleBuffer, True) SetStyle(ControlStyles.ResizeRedraw, True) MyBase.BackColor = System.Drawing.SystemColors.Control MyBase.Size = New Size(yourDefaultWidth, yourDefaultHeight) End Sub Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Diesel Posted September 19, 2005 Author Posted September 19, 2005 Ok, take that control you just made. Place it on a form. Now resize it. I want a control that is not RESIZABLE!!!!!!!! at design time. Design time is when you place a control on a form. I'm not taking my anger out specifically on you DiverDan, but the last 3 questions I've posted, I've recieved answers that are irrelevant.
*Experts* DiverDan Posted September 19, 2005 *Experts* Posted September 19, 2005 I guess that you have little to no experience with user controls and your anger is a big deterent for helping you....But use my code to set the correct size FIRST!!!!! Then if you want to control the Resizing of the control then restrict the Overrides OnSizeChanged Sub. It's that simple and that easy!!! You might also check into all the Overrides properities and educate yourself a bit prior to posting to avoid this type of frustration and silly posts in the future! Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Diesel Posted September 19, 2005 Author Posted September 19, 2005 So, your saying that OnSizeChanged fires in design time?
*Experts* DiverDan Posted September 19, 2005 *Experts* Posted September 19, 2005 Try it and you'll know!!! Right now I'm through helping you!!! Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Diesel Posted September 19, 2005 Author Posted September 19, 2005 I did, it didn't work. Also, I'm looking to actually take the resize hooks off the control at design time.
Leaders snarfblam Posted September 19, 2005 Leaders Posted September 19, 2005 What you are looking to achieve can be done via classes in the Design library, I believe in the System.Windows.Forms.Design namespace. You can enable/disable different sizing handles in the designer. You can also override the OnResize event and only call MyBase.Resize when you are in runtime mode. (I found this out through a google search). My recommendation would be reading some tutorials on designer aspects of control development. [sIGPIC]e[/sIGPIC]
Diesel Posted September 19, 2005 Author Posted September 19, 2005 I don't need a custom UI editor. My recommendation for you would be reading some tutorials on how to use google.
sgt_pinky Posted September 21, 2005 Posted September 21, 2005 LOL, Diesel. Keep up with the attitude. Pretty soon noone will help you, or better yet, you will be banned. Next time you want to be a tool, think about the fact that you have asked a question to generous people that are willing to help you for free.
Diesel Posted September 21, 2005 Author Posted September 21, 2005 Your another one. Think about the fact that I'm on here many times a week answering questions, for free. I have an attitude because I hate it when people pretend to know something and hand out misinformation. There's a lot of dumbasses that get paid a lot of money to do nothing. If someone else doesn't point out that they don't know what they're doing, they'll keep getting paid. This question was never answered, if anyone else wants to take a crack. OnSizeChanged is not how you do it. As far as I can figure, you have to use the function CreateParams and edit one of the control styles flags.
Recommended Posts