Answered by:
Panel flickers when pressing tab or alt keys

-
Hi all,
I have two panels (without images) in the main form, when the program loads there is no problem, but if I press the "tab" or "alt" keys the 2 panels flicker but just once, if I press again the keys nothing happens.
So far I tried:
- Add the form's DoubleBuffered = True
- Created my own panel using:
Public Class MyPanel Inherits Panel Public Sub New() Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True) Me.SetStyle(ControlStyles.ResizeRedraw, True) Me.SetStyle(ControlStyles.UserPaint, True) Me.SetStyle(ControlStyles.OptimizedDoubleBuffer, True) End Sub End Class
But nothing seems to work, any ideas?
Thanks in advance.
G.Waters
Question
Answers
-
After lots of time making the form again, I noticed that I had this property in order to show the form in the working area correctly (since it's a borderless form), this was the cause:
Protected Overrides ReadOnly Property CreateParams() As CreateParams Get Dim CP As CreateParams = MyBase.CreateParams CP.Style = &HA0000 Return CP End Get End Property
G.Waters
- Proposed as answer by Cherry BuMicrosoft contingent staff, Moderator Tuesday, April 25, 2017 2:58 AM
- Marked as answer by George Waters Tuesday, April 25, 2017 2:54 PM
All replies
-
-
Hi George Waters,
I've made a simple Form (DoubleBuffers=True) with two Panels and one TextBox is in each Panel.
And added a Class "MyClass" that had the same code as you showed.
No flickers on those Panels when I pressed [Ctrl] or [Alt].
I suppose there are something that you have not described.e.g. what kind of controls are there in your Panels?
Please explain more details.
____________
Ashidacchi -
After lots of time making the form again, I noticed that I had this property in order to show the form in the working area correctly (since it's a borderless form), this was the cause:
Protected Overrides ReadOnly Property CreateParams() As CreateParams Get Dim CP As CreateParams = MyBase.CreateParams CP.Style = &HA0000 Return CP End Get End Property
G.Waters
- Proposed as answer by Cherry BuMicrosoft contingent staff, Moderator Tuesday, April 25, 2017 2:58 AM
- Marked as answer by George Waters Tuesday, April 25, 2017 2:54 PM
-
Hi George,
It seems that you have solved your issue by yourself, please remember to close your thread by marking your post as answer, it is very beneficial to the other communities who face the same issue.
Thanks for your understanding.
Best regards,
Cherry Bu
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.