I have a strange problem and I can't seem to figure out a solution.
I have a windows forms application written in C# .net4.0.
In this application, there's a panel where i draw a chart on.
This chart is drawn on the "Paint" event of the panel.
There's also a button which launches another application on top of this application which displays other information
All of this works fine, untill I close the opened application.
When I Close it, i see my first application again but parts of it haven't been repainted.
It seems that the panel with the chart repainted correctly, the rest of it's container panel didn't.
I removed the "Paint" event of the Panel with the chart as a test and then, everything worked fine (offcourse no chart was drawn)
Strangly, I only do have this problem when the programs are in an RDP session.
On my local pc, everything works/refreshes fine.
If anybody can help me on this, it would be very much appreciated!!
For clarity I have added screenshots below:
we have a lot of rendering problems on RDP too.
Try setting the values mentioned here:
http://blog.tedd.no/2011/04/28/optimizing-rdp-for-casual-use-windows-7-sp1-remotefx/
Also we have implemented additional refreshes when using our application over rdp, although weird, it seems to help. We haven't found a really good and clean solution yet.
You can also alter RDP behavior in the options menu when you start the RDP session. We are using transparency, for example, and had to turn of bitmap caching.
Related
My first post here so here goes,
i have a UserControl with about 30 controls (labels, textboxes etc).
Now i would like to make a "screenshot" of it.
So i used the "DrawToBitmap" method from the UserControl.
Here some samplecode
//this is the UserControl with the about 30 controls
var sampleusercontrol = new SampleUserControl();
var bmp = new Bitmap(sampleusercontrol.Width, sampleusercontrol.Height);
sampleusercontrol.DrawToBitmap(bmp, sampleusercontrol.Bounds);
if i run this code, it returns me a black image all the time.
I have no clue why. Please help!
Edit:
Forgot to say that the UserControl is a WinForms UserControl
This had been working for me for years until it started returning a black image last week in production. Interestingly, it was just after we applied a new windows patch. I was able to find this posting about the issue:
KB3057839 Has Broken Windows Forms Control.DrawToBitmap() When Called from Application Launched From Windows Service
You didn't mention how that winforms control was being created, but in the first case it was from a winforms app launched by a service. There is also a case on the Telerik site where the control was instantiated server-side by IIS to create a PDF file:
http://www.telerik.com/forums/export-to-pdf-597e04c01b39
Try checking for the patch KB3057839 and rolling it back for a short term fix. Hopefully Microsoft will respond with a fix or a workaround going forward.
I had the same issue. The latest round of ms patches corrected the issue.
Check that the control has been loaded.
I was struggling with this, but it turned out the control was in another tab and wouldnt display correctly until I had clicked on the tab, then run DrawToBitmap.
So I have an odd issue while trying to use a WPF TextBox with SpellCheck enabled inside a Winforms form, using the custom control defined in this post.
This works just fine, I've tried using it in my own sandbox project and it looks great. The problem is when I try to replace the Winforms TextBoxes inside one of our existing forms. The SpellCheck context menu is "trapped" inside the control, so all I can see are the up/down arrows of the menu.
I'm not too familiar with Winforms, as I mostly work with WPF, so I'm having a hard time determining the problem. The text box shown above is the custom control as mentioned in the linked post. The control is contained in a forms TableLayoutPanel. How can I get the context menu to expand and actually be visible?
Edit
First, to clarify, the context menu appears normally when displayed in a console application that opens the form. I did a little more testing and created a new web project (what the original problem project is) with a button that opens the form, and then the problem behavior occurs. What difference between the console application and the web application would cause this?
Edit 2
I tried the suggestions in this post, thinking maybe the context menu really was just being automatically sized incorrectly (to fit the parent control). But none of those solutions seemed to make any difference either.
Edit 3
After using snoop to look at the differences between the working context menu (windows application) and the not-working one (xbap) the only difference I could see was that the DesiredSize of the xbap instance's context menu has a smaller size, I just have no idea why.
The wpf control is a control which is hosted in winforms via the ElementHost.
Hence it lives within the area provided by the parent.
The only way is to expand it, is to change the size of the parent. Give it a try by creating a winform supersized textbox as a quick debug example. Note whether the size change works on not. If it does can the GUI accommodate that change? I can't answer that.
i have create a few WPF applications in visual studio, and now i would like to create a final application to run all of the created apps in the final application. i would like to know how i can create a layout that displays the apps that are running inside the final app as buttons that can be clicked and cause the app to expand and allow the user to work on that app and then when finished return back to the final app and see the other apps to choose from. I imagine it would look like a Google chrome blank page that allows you see your familiar webpages and click on them to load them up. Any help or advice on what i should focus on to implement this would be much appreciated.
Thank you for taking the time to read over this.
Consider using a VisualBrush this takes other WPF UI (your "apps") and uses their UI as a brush for another UI element.
Raj Kumar has a simple article called Visual Brush in WPF for details.
The bit you probably want is at the bottom where he shows you rendering a controls content in another control. The magic being binding the controls visual to the element name whos UI it should render.
I'm having a persistent problem with my VS2010. After working for a while, the display will start to glitch out. The code all shows as black-on-black (I use a dark background because it's easier on the eyes, but even when I switched to the default, it just makes the text white-on-white instead.) All tooltip hovers appear in the upper-left corner of the screen instead of where they're supposed to. If you select text, the code that gets selected is nowhere near where you clicked the mouse. (Not that you can read the text anyhow since it's the same color as the background.) And none of the dockable panels will appear or if they do they're all glitched out as well. The only solution seems to be closing the program and restarting it. I've been using this copy of VS2010 for years without issue, and my other projects don't seem to have any problems. This one is C#, uses a lot of Windows Forms (not WPF), has some customized Controls, but otherwise isn't all that unusual. I have the following extensions:
CodeMaid
CSharpIntellisensePresenter
InheritanceMargin
ProductivityPowerTools
Tunnel Vision Labs Output Window Services
WatermarkTextBox Control
Some of these are recently installed so they may be the culprits. Has anyone had any display problems with any of these extensions? I can live without most of them, but I'm not sure if it'll make a difference. There's no easy way to test it either, as the glitch only shows up every couple of hours or so.
I've created an application with Glade and GTK# in windows XP:
at startup window is not maximized
I click on "Search" and a listview is filled with data from a database:
image http://www.microline.eu/Capture-1.jpg
I click on maximize button the window freezes and does not respond
any suggestions?
Thanks
Added informations
On linux it works well
No code on maxime routine
My idea is that there is a bug in resizing procedure in GTK# for Windows
It's difficult to diagnose your problem without knowing what your code looks like - do you have any resize routines?
To solve your problem, I'd narrow down the potential culprits. Remove or hide one or more controls until you can find which control is responsible for the freeze on maximize.
Once you narrow down which control is causing the issue, determine whether it's the data in the control causing the issue. If it's the grid, see if the freeze still happens when there's no data in the grid.
If I change property Window position from Always center to None, then maximize works well.