Jump to content

Controls on glass frame


midora

Recommended Posts

I like to add more controls on the glass frame of the PrintIt dialog.

The dialog derives from PdnBaseForm.

This worked fine for buttons all the time.

But there is an issue with other controls. The background of the editboxes is not opaque And the background of text is not transparent. The text itself not readable (see the bottom right corner of the screenshot).

 

Is there any trick to solve this issue?

 

 

Paint.NET%20Controls%20on%20glass%20fram

midoras signature.gif

Link to comment
Share on other sites

I recommend not doing this ... Windows just does not handle this well at all and you'll end up chasing your tail and become exhausted and frustrated. Buttons should work okay as long as it's a PdnButton because those all use DirectWrite now (and are specifically tuned to work on glass). Other custom controls, and especially TextBox, are going to drive you mad though.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Windows just does not handle this well at all and you'll end up chasing your tail and become exhausted and frustrated. Buttons should work okay as long as it's a PdnButton because those all use DirectWrite now (and are specifically tuned to work on glass). Other custom controls, and especially TextBox, are going to drive you mad though.

 

Yeah, that's why I asked. I spent some time already and as you said solving one thing breaks something else.

 

But as it happens sometimes, asking triggers yourself and I figured out a solution working specific for NumericUpDowns. And that's enough in my case because I can put the appended label into the NUD as a unit.

The basic idea is described here.

 

Paint.NET%20NumericUpDown%20on%20glass%2

 

Thanks for the advice. I agree that you should not missuse the frame to place anything there. But in this special case it makes sense (IMHO) to use the frame for these dedicated controls.

midoras signature.gif

Link to comment
Share on other sites

I'm not so worried about "misusing the frame" ... it's your UI, you should do what you think is best for it.

 

I'm mostly concerned about the pain and suffering associated with getting GDI controls to work on glass. GDI tends to stomp the alpha channel.

 

Hmm ... I'm curious though. I wonder if hosting the WPF TextBox would work well in the glass area? I'm not sure what the performance implications would be. Paint.NET 4.0 uses WPF's dependency property system, so it's already incurring maybe half of the performance cost of loading WPF.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

I have in mind that you told once that only the settings dialog uses WPF and you may remove this dependency. But I may remember wrong.

 

Just from the point of the user experience, I prefer that application and plugins are using a similar interface. OK there are exceptions.

midoras signature.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...