Disable resizing out of browser Silverlight 4 Window [duplicate] - c#

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How can I prevent the user from resizing the silverlight out-of-browser window?
Is there any way to actually remove the ability to maximize/resize the out of browser window since I want my application to be of a certain size.
Thanks

I can't be 100% sure but I would hazard a guess you could just go:
this.resizable = false;
this.maximise = FALSE;
in the constructor of the views code behind file.

You can make any new window have no statusbar, no toolbar, no resize, etc. using window.open():
http://www.javascript-coder.com/window-popup/javascript-window-open.phtml
However, this is completely dependent on the browser, many ignore this, or have a user setting to override this behavior.

Related

Location of controls different between designer and run [duplicate]

This question already has answers here:
How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?
(6 answers)
Closed 2 years ago.
Does anyone know why the location of some of my controls is different between designer and run mode? It's driving me nuts. In designer they are all in the right location, anchored as should be, but when I run the application, the form is somewhat resized but the controls don't move accordingly. The ones on the outer right are all somewhat hidden, and resizing the form in run mode does not improve this as they are anchored.
Thanks
Designer view
Run view
Configuring the application to use the correct dpi setting was the solution. Thanks Jimi! :)

My Windows Form does not come up as the size I set it to [duplicate]

This question already has answers here:
How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?
(6 answers)
Closed 5 years ago.
When my WinForm loads it is always a lot smaller than what I set it to in the builder. For example, I set the size as 2169, 1398, yet it comes up MUCH MUCH smaller than what I wanted. Any answers or suggestions?
When specifying the size of your winform it's highly recommended to save the dimenions in a settings file. Then on your form_load event specify your width and height to the values saved in your settings.
A really good guide on how to do this can be found here
I should also mention that you're going to want to set form1.AutoSize = false to prevent it from changing on you.

How can I make a form "unresponsive"? [duplicate]

This question already has answers here:
How to make form system modal using C#?
(3 answers)
Closed 7 years ago.
Currently I have 2 forms open. However, I want one of both to be unresponsive while the other one is open.
It's not easy to describe, but I think all of you know that "plinging" sound when clicking on a main window while a prompt window of that form is open.
Is there a way to do this relatively quick?
I am pretty sure it would work with
Window.Enabled = false;
but I would prefer a way to perform it by setting an attribute only on the window I want the user to work on in that moment, instead of having to disable all others.
I could imagine something like
dialogwindow.Focus = true;
Is there a way to do this?
When you show your second window - you should show it with this method:
dialogWindow.ShowDialog();

Differentiate Window vs Page vs UserControl in WPF? [duplicate]

This question already has answers here:
Window vs Page vs UserControl for WPF navigation?
(5 answers)
Closed 8 years ago.
I wondered if someone could help me. I'm new to WPF and am currently writing a desktop application, but I cannot seem to get my head around what to use when redirecting someone to a new section of the application.
My options appear to be
Window
Page
UserControl
but I don't understand what the difference between them is, and when I should use each one.
Could someone explain the differences for me, and give an example of what situations/applications you may use each one for?
I'm not sure there is a right answer here, but let me try and guide you. The Window class was created to allow you to have a true window. So, if you need to open a dialog, put it in a Window. Generally you will have at least one Window to house the main form.
A Page was built to be used with the NavigationWindow class. This allows you to build Page classes that are marked up like everything else, but just navigate to them under the covers. This is good if you have a single-paged application where the users just go back and forth between pages (i.e. a wizard).
A UserControl is a way to house reusable markup. These can be housed inside of any ContentControl. These can be swapped out of a "content pane" for example on the main window, like Outlook.
Using that, I hope it helps guide you in the right direction on when to use which. They each have their own uses and are not necessarily exclusive.

How to show the form with the desktop background dimmed? [duplicate]

This question already has an answer here:
C# Best Method to Dim Screen, Multiple Windows Forms?
(1 answer)
Closed 9 years ago.
I want to show the winform to be displayed, however the form would be in the normal state (not maximized). However, i want to dim the desktop background to be dimmed for user attention.
Maximized form with background dimmed is an option, but i don't want to maximize the form.
Maximized form with background dimmed is an option
Firstly if the form is maximised, then there is no point in doing anything with the background as it cannot be seen.
i want to dim the desktop background to be dimmed for user attention
This is messing with the OS settings, and I am not even sure if it is possible and it is certainly not desirable. I, as a user, would never want an application messing with my other running programs or my OS settings/preferences.
In short what you want is not possible (at least with out some nasty code) and it is not good practice.
I dont think you can change the background, as well as I dont think you should.
I'd try to open "maximized" form with large opaque (or half-transparent) border.
May be this will be helpful

Categories

Resources