ReadOnly Property

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
nirmalks
Posts: 30
Joined: Sun Aug 02, 2015 10:01 am

Re: ReadOnly Property

Post by nirmalks » Thu Mar 17, 2016 5:39 am

Hi there!

Now I'm able to reduce flickering for most of the controls on the form, but somehow DoubleBuffered property doesn't work for Combobox and Treeview controls.

I've been reading over Internet and came across this code:

protected override CreateParams CreateParams {
get {
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED
return cp;
}
}

How do I use above code in PowerShell or Is there any way to set DoubleBuffered property for individual controls on a form?

Thank You,
Nirmal

jvierra
Posts: 13882
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: ReadOnly Property

Post by jvierra » Thu Mar 17, 2016 5:55 am

DoubleBuffered is set on the form and inherited by al controls that support it.

The code you have posted shows how to customize this in user controls inherited from controls that support the option.

User avatar
nirmalks
Posts: 30
Joined: Sun Aug 02, 2015 10:01 am

Re: ReadOnly Property

Post by nirmalks » Thu Mar 17, 2016 6:51 am

Yes, you're right, but I can't stop flickering on controls like Combobox and Treeview.

Is there any way to stop flickering for these specific controls?

Thanks again!
Nirmal

jvierra
Posts: 13882
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: ReadOnly Property

Post by jvierra » Thu Mar 17, 2016 7:08 am

What are you doing that causes flickering?

User avatar
nirmalks
Posts: 30
Joined: Sun Aug 02, 2015 10:01 am

Re: ReadOnly Property

Post by nirmalks » Thu Mar 17, 2016 8:02 am

Here are two things that are really bothering me:

- When I select a node in Treeview, it flickers
- When I hover mouse over Combobox, it filckers.

It looks like these controls are sending some messages to the system or they refreshes itself.

Thanks,
Nirmal

jvierra
Posts: 13882
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: ReadOnly Property

Post by jvierra » Thu Mar 17, 2016 8:36 am

I have never heard of that. It must be your code causing that.

Locked