Rendering slowly after hiding a control - c#

I'm encountering a new phenomenon (I've never seen it before), after hiding a control and switching tab it moves super slow and some times I can even see the hole the hidden control left on the same spot in the different tab.
and even pop up a file dialog take a very long time after the operation.
(I've seen similar question not exact and none of the solutions seems to work in my case)
*) the controls I'm hiding are simply in a group-box container no data grid or such.
Any suggestions?
Thanks!

Related

WPF Helper lines in Designer mode not showing any more

I have searched around using different terms, I don't know the correct name of what I search so it's hard to find something relevant about it.
In Winforms when you drag a control into a form and drag it around if there is another control you will see visible lines in the designer (snap lines I think) that are showing the alignment from the control you are dragging to the other. In WPF there was the same but I don't have it anymore and I can't find it anywhere in the tools/options. I did not change anything to my knowledge that would change that behavior.
Is it due to an update and they removed it or what happened that I don't have it anymore?
See bottom, left side of the designer. There are a couple of toggle buttons there which may be of help.

How would you create a page like WP's Mail app's Compose screen?

I'm new to WP dev (and pretty much C# and Silverlight in general) and I've been playing with Textboxes. I found pretty quickly that you can't really scroll a TextBox control.
I've seen some solutions to this on various blogs and StackOverflow posts, and the most popular one seems to be to embed the TextBox in a ScrollViewer, then use some code to make the current input line always visible, like this:
scrollViewer.ScrollToVerticalOffset(textBox.ActualHeight);
This works okay if you have a relatively small TextBox, but if you want to make one that takes up quite a bit of space, you run into problems where the keyboard covers up the bottom section, you can't scroll to the top unless you manually move the cursor up there, etc.
Now the Compose page of the Mail application seems to do this perfectly: a nice big space for text entry where the keyboard never blocks the input, you can freely scroll through the entire pane, it just works really. I've tried various combinations of scrollviewers and textboxes but I haven't had any success in matching its behavior.
Any help?
The default apps are not written in C# using controls accessible in SDK or on the net.
Replication of mail viewer and composer has been tried before rather un-successfully. (Based on similar posts of AppHub - old WP7 forum)

Windows Forms Panel control slowly creeping

So I'm working on a card maker for a TCG. I seem to have encountered a very odd glitch and can't find a decent workaround. I have several panels that contain various controls for determining the different variables of the card, like so:
However, I've noticed that if I go into the Form1.cs file and change code--any code at all, from adding/removing comments to deleting and restoring a semicolon--and then go back into the design view, the design view window goes black for a moment whilst it redraws everything, and then pops back into place...except that the right-hand side of various panels has been bumped to the left about 5 pixels. It doesn't seem like much, but after multiple changes, multiple swapping back and forth between windows I get this:
...which of course is hideous and unusable. For a long time I couldn't determine why some panels did it and others did not, but finally while reworking the Keywords tab you can see in the screenshot, it dawned on me that it was any panel that I have set to anchor both on the left and right hand sides of the parent control. This is to allow the user to resize the window to their heart's content. I currently have a kludge in place in which I modified Form1.Load() to hard-code the size of the affected panels. This is of course entirely against the whole point of using a visual editor in the first place.
The hierarchy of the controls goes Form1->SplitContainer->SplitContainer.Panel2->TabControl->StatsTab->StatsPanel. This unfortunately doesn't appear to be a code-based problem since I don't write any code to affect this. The redraws apparently actually change the StatsPanel.Size property, and if I cycle back and forth I can watch it sloowly decrement.
So, does anyone know what might be wrong? I don't like to jump to "oh Microsoft has a glitch in their editor" but I can't find anything else that I am doing or setting that could be causing it. Any help would be most appreciated.

How to fix weird scrolling/alignment behavior when using keyboard in MenuStrip?

I started noticing strange behavior when navigating the main toolbar of my Winforms application, and I don't know how to fix it. When I initially open the dropdown of the File menu, it looks like this:
I begin to scroll down each item with the arrow keys, and everything is fine until I reach "Exit". As soon as I hit the down arrow key from "Log Off", or if I hit the up arrow key from "Open", the menu rearranges itself to look like this:
I'm puzzled by this behavior. The menu still works, and from this point, if I start scrolling up, I can get the arrangement back to normal:
A few observations:
The menu still works.
This doesn't happen when using the mouse.
I have some code that toggles the Visible property of some of the menu items. I was able to modify what the arrangement was by playing around with this, but it was still messed up.
Can anyone help me understand what is going on, and how to fix it?
I found the source of this problem. It is a known bug that Microsoft apparently doesn't intend to fix. The problem happens when you attempt to toggle visibility/availability of menu items during runtime. Microsoft reminds us that "this issue is purely visual, there's no functionality loss."
Their suggested workaround is to add/remove the menuitems rather than show/hiding them.
Another workaround is suggested on the forums: deriving from ToolStripDropDownMenu, turning off AutoSize, handling it on your own, and adding 1 extra pixel of height.
I found a blog post that addressed this issue, but the author never got around to posting his solution. He makes a useful point concerning Visible vs Available, however.

ASP controls "shifting" in C# web app

I am working on a 2.0 framework C# web application. Recently it was brought to my attention that when an event occurs (button submits in particular) on the page and then the other ASP controls are moused over (textboxes, radio buttons, regular buttons) they appear to shift down, all the while you can see the control in its original position underneath (This gives the effect of having duplicate controls, one overlapping the other). When the page is refreshed the issue goes away until another event takes place.
To give some background, the users only experience this in IE. Of all the people I had test this, it only happens on a very small number of computers. One last thing to add is that I am incorporating JQuery rounded corners in the divs above the controls that seem to "break".
Has anyone seen this issue before, and if so, how was it fixed? A little bit of insight would be great.
Thanks in advance!
I'm guessing your jQuery code is cloning the HTML elements. If you turn off your jQuery to round the corners, does the problem still occur?
I haven't heard of this particular bug before, but it may be one that's fixed using the IE Zoom fix, which fixes bugs caused by IE6's strange float model.

Categories