I've researched this a bit and can't seem to find an answer. A few articles here on SO also go unanswered or provide answers that don't seem to work so I'm running out of luck and hoping someone can help.
I've got a WinForms project, coded in VB.Net, using .Net Framework 4.6.2.
I wanted to the app to load in the system tray, and when clicked the actual form comes up. I got this to work using feedback from another article which implies creating a separate Module, include a Sub Main() declaration, load the Notification item in there and when system tray icon is clicked then load the main form.
To do this, I had to go to my project settings, select the "Sub Main" as the startup object, and un-check the "Enable application framework" box.
Everything works as it's supposed to, the notification icon is loaded in the taskbar, and when clicked my form opens up.
Here's the issue, when my buttons are rendered they look way different than when I setup the project to run the form instead of the windowless module. Example:
Buttons should look like:
But look like:
A few articles pointed to enabling the following options in my main module:
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(True)
Application.DoEvents()
This fixed the way my ListViews were rendering, but not the text. As you can see in the images, the top one is much more smooth and well-spaced than the bottom which looks bolder and misaligned.
I've tried changing the form's AutoScaleMode settings, AutoSize, and nothing works.
Any idea on how to fix this?
Setting the default font of the form worked, as #Çöđěxěŕ recommended.
Related
I'm having a problem where a winforms application I wrote is always in front of other applications.
Its TopMost property is set to false and yet whenever I click on anything else on my computer (Google Chrome, Windows Explorer, etc) the winforms application stays in front of them, albeit grayed out. This means that to effectively use other applications while my winforms app is running, I have to minimize it.
I'm wondering if there's a way to change it so that it works like a normal application, where it goes behind other windows that are clicked on without minimizing or closing it
Pics:
Upon opening the app
Upon clicking on VS
As you can see, clicking on visual studio does gray out the app, but the app still shows in front of VS. This is the same behavior with all other windows.
Here are the properties of the form:
And the rest of the properties:
Turns out that one of the methods does programmatically change the value of TopMost to true, so that was causing my problem. Thanks to fujiFX for pointing that out as a possible reason
In this screenshot on the left you see ExtdTextBox and ExtdTextBox1 and on both near it there is no this gear icon in purple. Where is it ?
By purple gear i mean this for example:
Your screenshot shows the standards ToolBox icon for UserControls.
This is probably what ExtdTextBox and ExtdTextBox1 are.
If you really wanted you could try to change the icon to show somthing else, at least if you have access to the sources and can add an ToolboxBitmapAttribute to it. See here and here for details.
However, even if you do that I don't think chosing a gear icon would be a good idea since these are usually picked for items that control settings. The example you show, from a more colorful incarnation of VS shows AJAX controls, which may explain the gear since they will talk to a server..
Also note, that the doc says that for the custom icon to show it is necessary to explicitly add the controls to the ToolBox via Add to toolBox..
I don't think it'll be worth the hassle.
Hello StackOverflow Community,
I hope I am able to describe my problem so that it is possible to answer it!
In abstract: I want to expand the windows 7 control panel.
I know that you can add an link to the mainpage which starts your app. See http://msdn.microsoft.com/en-us/library/windows/desktop/cc144185(v=vs.85).aspx
What I want to do the is go a step further. I you click through the control panel, you can see that there are some setting "pages" which don't open a new window. You are getting to a new "page" and in the top area is the name of the dialog added to a navigation bar.
What I want is this exact behavior for my app.
Here you see a screenshot of a settingsdialog which has the wanted behavior. I would like to integrate my app like this.
My application is going to be a settings dialog for windows 7, similar to the customization page. I already asked this question on msdn without success.
Sincerely yours,
AxP
What you're seeing here is Windows itself, not some random app. It is there because Microsoft hardcoded a link to this page in a Microsoft product.
To be more precise, you see here Explorer.Exe (which contains the control panel) showing settings for the desktop background (which is also Explorer.Exe).
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
When I set focus on a text box, on a forms load event in Windows Mobile 5.0, the Windows tool bar appears even though my form is maximized.
When I do not set the focus on the text box the form opens maximized. I do not want the windows tool bar appearing.
How do I prevent this from happening?
TThe start bar in WinMo is actually not part of your app - it is a separate process managed by the Shell and it really wants to always be on top. Trying to get your app above it goes against the design goals of WinMo (though it's a common thing to want to do).
I'd recommend doing some searching and reading on "kiosk mode" to garner what knowledge you can from others who have been down this road, but what you're seeing is that the StartBar is getting set topmost.
Raffaelle Limosani has a pretty decent blog entry that covers kiosk mode, so it's a good place to start (take a look at the other blogs he links to as well).
The toolbar at the top is actually a separate window, and it has a habit of appearing when not wanted over top of a full-screen ("kiosk" mode) app. For example, if you ShowDialog a second full-screen window from the first, the Start window flickers up for a split second before going away.
The only way I ever found of dealing with it was to hack into the API and actually make the Start window hidden while my application was open. This is a big potential problem, because if your app crashes without making the Start window visible again, it will stay invisible until you reset the device (or run you app again successfully).
I'd advice against doing this unless you absolutely have to. As ctacke points out, this would be an example of an app not playing nicely with Windows Mobile.