JCreationsInc Posted July 7, 2003 Posted July 7, 2003 Hello people of the metal box on my computer. I am creating a application that will easily allow me to create skins for my future applications. Well in this application, there is a feature that allows you to preview your progress, creating a window and drawing the skin to the window from the paint event. Well now to the nitty gritty, I need to set the created window's ControlStyles: Window.SetStyle(ControlStyles.AllPaintingInWmPaint, True) Window.SetStyle(ControlStyles.UserPaint, True) Window.SetStyle(ControlStyles.DoubleBuffer, True) When I try to do it from my skin drawing procedure it wont compile due to the "SetStyle" function being protected. So what I was wondering is there another way of setting the ControlStyles?:confused: Quote When in doubt.... use the sledge Hammer!!
*Experts* mutant Posted July 7, 2003 *Experts* Posted July 7, 2003 You can do it only in the form itself. So maybe you could edit the constuctor of the form that shows the skin or put in Load event, but you have to do it in the form itself, cant do it from another class. Quote
JCreationsInc Posted July 7, 2003 Author Posted July 7, 2003 Sounds good.. I will try the load event, I was just reading a artical on msdn that mentions the same thing along with the function updatestyles. Thank you for your help. I will post the results of my escapdes for the world to see. Quote When in doubt.... use the sledge Hammer!!
JCreationsInc Posted July 7, 2003 Author Posted July 7, 2003 SUCCESS! Success! Thanks here is what I got.. Public Sub CreateWindow() Dim TestFrm As New Form() AddHandler TestFrm.Load, AddressOf TestFrm_Load TestFrm.ShowDialog() End Sub Public Sub TestFrm_Load(ByVal sender As Object, ByVal e As System.EventArgs) 'Set the value of the double-buffering style bits to true. Me.SetStyle(ControlStyles.DoubleBuffer Or _ ControlStyles.UserPaint Or _ ControlStyles.AllPaintingInWmPaint, True) Me.UpdateStyles() End Sub Quote When in doubt.... use the sledge Hammer!!
*Experts* mutant Posted July 7, 2003 *Experts* Posted July 7, 2003 What you are doing is setting those flags for the form you have the code in, not the one that shows skins. :) You have to edit the class of the form that shows the skin. :) Quote
JCreationsInc Posted July 7, 2003 Author Posted July 7, 2003 Right ON! Thanks for your help I appreciate it! :) Quote When in doubt.... use the sledge Hammer!!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.