I have a Windows Form designed with Visual Studio 2010.
It has a ToolStripContainer with a StatusStrip control placed on the bottom.
From the Visual Studio IDE's Designer, the control looks fine:
When I run the application, the StatusStrip object on the bottom becomes transparent/opaque, and is very hard to read. This project is only about 2 weeks old, and I have not done anything to monkey with the transparency or opacity of any of the controls.
What could be causing this? How would I debug it?
EDIT:
So, I did a search on my Current Project on the control's name (statusStrip1). Unfortunately, there is very little information. I also ran a search on the ToolStripContainer, but it had roughly the same information - nothing that should cause the display to be transparent. The StatusStrip search result is shown below:
You won't believe this.
I stopped this problem by setting the WinForm's TransparencyKey to Fushsia (it was set on Transparent).
Related
I experience a strange bug on Visual Studio 2019, and I want to know if you can reproduce it too on your project.
Usually, if you click on the form and then start dragging the mouse, you will see a selection dashed rectangle that shows which controls on the form will be selected. The problem I see is that if my Form is pretty large, for example 1900x995, then when I click and drag with the mouse on the right bottom area of the form, the selection rectangle is cut in the middle.
See this picture for better understanding:
https://i.ibb.co/xzZLfsD/VS219-Form1-Selection-Bug.jpg
If my calculations are right, then it looks like the selection rectangle is cut at about 1570x846 (if the Left-Top of the Form is 0x0).
To reproduce it, open a new project of type:
C# Windows Forms App (.NET Framework) A project for creating an application with a Windows Forms (WinForms) user interface.
Important note: It's not happening if I choose C# "Windows Forms App (a project template for creating a .NET Windows Forms (WinForms) App)".
Set the Form size to 1900x995, then click any point on the bottom-right area of the form, and start dragging with the mouse to the bottom right corner of the form.
Do you see the selection dashed rectangle cut out in the middle?
Please let me know, I want to know if it's happening only on my installation, or is it a bug in the Visual Studio 2019 itself.
If you have other version of Visual Studio, for example VS-2017, or VS-2020, please check it also. Maybe this problem occurs in other versions too and not only in 2019 version.
Thanks.
I'm sure I can't be the first to ask this question but I couldn't find an answer. I have designed the GUI of an app with the Form Designer and it looks like this:
As you can see, there are large gaps between the labels and text boxes that don't exist on the designer. I've tried locking them but to no avail...
Your problem is very casual, and solution is quite simple.
Please place your controls/control groups on panel controls (see in Toolbox). Then please set docking or anchor settings for panels and controls but remember, that control cannot use both - anchor and docking settings.
Hope this helps.
i recently installed visual studio 2015 and made my first code in c#.
('maximized' for window state at the properties of the form)
everything went fine (comilation and testrun without errors) until i attempted to load one of the example tutorials, which i interrupted during loading.
after that i compiled and started my self coded application again from within visual studio. this time the output of the form was, unlike before, displayed half its size.
all the buttons including the window of the form appeared half its original size.
but when i executed the comiled application outside of visual studio (without it actually running) the application started in normal scale as intended.
this effect happens for this specific project only. if i start a new project the compilation & testrun will show a form scale as expected.
so my question: is there any magical setting that i have to change to end this nightmare ? i dont like to start all over again with a new project. i had set up 72 different button already. each buttonpress causes a different
SendKeys.Send("");
to be executed.
Check the Form's AutoScaleMode property!
The default is Font:
Controls scale relative to the dimensions of the font the classes are
using, which is typically the system font.
If that won't help do try to create a new project and copy the relevant cs-files into it!
In theory there is a zoom option in the VS designer, but at least in the Winforms desiner the shortcut does nothing for me.. It probably is for the WPF designer.
You did tag the question correctly and it is indeed about Winforms?
With the Weifen Luo DockPanel component, one can add to their .net project the ability to dock forms within other forms. The component is very well done.
Now, I see from this page at the project forum at github (where this component is now hosted), that it is possible, through the use of this dock.extender to allow the floating windows to have a normal winform look, that is, sizeable with regular Windows title bar, maximize box, minimize box, etc (see here, too). This also allows for the form's icon to show.
My problem is, and hence my question, is that the icon I assign in the form's properties will show in the designer, but one it runs in debug as a float-panel, a generic form icons appears in its place.
Now, I tried assigning the icon through code (both in the form's own code, and in the main application code too, where the form is called) rather than through properties, and that didn't work either.
So how do I get my own custom icon to show as the form's icon when the form is floated, and the extender is used? I am using the main docking panel in DockingWindow mode.
[EDIT]
I think this is a hard question! It's been 2 days and I've not gotten any answers!
This requires a change to the the FloatWindow class itself to set and update the Icon property internally as the content changes.
I have just checked the change in and it will be included in the 2.7 release of the library.
https://github.com/dockpanelsuite/dockpanelsuite/issues/35
I've rewritten a toolbar that sits at the top of the user's screen. It works, but for some reason, though the app consists of just a form with a Fill-Docked ToolStrip, I cannot get it to stay at the size I specify. It's supposed to be the size of the Windows titlebar, as designed in Visual Studio, but as soon as I run it, it's grown in height by five or six pixels. Everything is set rigidly, the Form and ToolStrip are set to AutoSize=FALSE and I've specified the size in pixels the form should be. I cannot work out what is resizing the form at runtime; the ToolStrip is Docked on Fill mode so it should not cause the form to grow. It all looks perfect in the GUI builder, and I copied most of the configuration from the old VB.Net toolbar it will replace. Can anyone help?
Just a wild guess, but have you tried changing the AutoScaleMode property of the Form to something other than Font?
Haven't found an answer but I'll make sure this is closed. I turned the form transparent and it accomplished what I needed. Still unsure why the form expanded when run.