Hide Title Bar in Compact Framework - c#

I am working in a Windows mobile project.
Due to some project requirement I need to Hide the form's tittle bar, but didn't find any properties of the form to do so.
Any suggestion would be appreciated.
Thanks in advance

to hide the forms title bar you have to use
this.WindowState = FormWindowState.Maximized;
if you like to hide the menu bar too, use
this.Menu = null;
In general a Windows Mobile Form does not have a caption but the form's title (caption text) appears as part of the top bar.
~josef

Considering you are using Winforms using WPF you can try consider this:-
this.ControlBox = false;
this.Text = string.Empty;
Otherwise, you could set FormBorderStyle to None.
or you can try this:-
this.ShowInTaskBar = false;

I haven't developed for WindowsMobile, but I have for Windows CE. In Windows CE, I would do the following to hide the Window Title Bar.
FormBorderStyle set to None
ControlBox - False
MinimizeBox - False
MaximizeBox - False
Try that

For window CE devices you can try these properties to hide title bar.
TopMost ====> TRUE
WindowState =====> Normal
FormBorderStyle ====> None
hope it will help you... :)

Related

ShowInTaskbar not working reliably in WPF

I have a modal window in WPF and for this window ShowInTaskbar is set to true but application icon is not showing in taskbar every time for this model window. Sometimes the icon shows up in taskbar and sometimes it does not. But the requirement is application icon should always be visible in the taskbar when this modal window (using ShowDialog) is launched.
window Style is set as : ThreeDBorderWindow
Code to show modal window is :
winIHelper = new WindowInteropHelper(_shell);
_shell.SizeToContent = SizeToContent.WidthAndHeight;
winIHelper.Owner = parentHandle;
_shell.ShowInTaskbar = true;
_shell.Activate();
_shell.ShowDialog();
I had a similar case where ShowInTaskbar was not working correctly when a different window (Splash screen in my case) was shown without setting any Owner.
So, settings the Owner property of the Other window - solved my case.

Winforms, Minimized, Text

I am new to WinForms and am currently developing a simple application. I am not too sure if it is possible, but I would like to display the Form's text value (or some text value) in the taskbar when the application is minimized, rather than the icon?
You can set the text of your application by:
this.Text = "Text that you want to display";
paste the above line of code in your Form's constructor just below the InitializeComponent() method.
The answer is Rohit Vyas's. But due to your comment, you're looking for:
Right-click on taskbar -> Properties -> Taskbar buttons: Never
Combine.
Title usually appears in the taskbar of Win xp and many windows
it can be set like this in win forms
This.Text ="Some Text";
But in Win 7 it will always give you the icon unless you change the properties of windows.
This is not possible without going into COM/Interop stuff and even then I would not advise it. Why not use a text icon instead, or you could look at the NotfyIcon Class.

Hide my application from taskbar

Is there is away to hide my application from task bar?
I have tried:
Me.Hide()
but this hides the form not the application from the task bar.
try this one:
Me.ShowInTaskbar = False
Use the ShowInTaskbar property and set it to False in your Form.
You can do this in the designer, too:
use ShowInTaskbar property and set to false.
For example:
Me.ShowInTaskbar = False

Disable resizing of a Windows Forms form

How do I turn off the user's ability to resize a Windows Forms form?
I'm having it resize itself on a click.
Take a look at the FormBorderStyle property
form1.FormBorderStyle = FormBorderStyle.FixedSingle;
You may also want to remove the minimize and maximize buttons:
form1.MaximizeBox = false;
form1.MinimizeBox = false;
First, select the form.
Then, go to the properties menu.
And change the property "FormBorderStyle" from sizable to Fixed3D or FixedSingle.
More precisely, add the code below to the private void InitializeComponent() method of the Form class:
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
Explanation
By default, FormBorderStyle property has the sizable value FormBorderStyle.Sizable assigned. Which enables form to be resized.
There are 7 kinds of FormBorderStyle property values available to use.
None
FixedSingle
Fixed3D
FixedDialog
Sizable
FixedToolWindow
SizableToolWindow
Depending upon the kind of form, we can assign the appropriate value accordingly.
Assuming your form name is form1.
Choose any one from below to make it as Fixed
FixedSingle, Fixed3D, FixedDialog makes the form non-resizeable, assigning None will also work but won't make sense without a control box in case.
Code
Code snippets below, use any one of them
FixedSingle
form1.FormBorderStyle = FormBorderStyle.FixedSingle;
Fixed3D
form1.FormBorderStyle = FormBorderStyle.Fixed3D;
FixedDialog
form1.FormBorderStyle = FormBorderStyle.FixedDialog;
None [Optional] Note: There'd no control box
form1.FormBorderStyle = FormBorderStyle.None;
Or, Graphically
We can apply it graphically like this.
Make sure you've selected the form which you want to make it fixed size. then you'll see a property named FormBorderStyle property there in Properties window.
Another way is to change properties "AutoSize" (set to True) and "AutosizeMode" (set to GrowAndShrink).
This has the effect of the form autosizing to the elements on it and never allowing the user to change its size.
None of these answers worked for me, perhaps because my window had a status bar. To fix I did this:
StatusStripObject.SizingGrip = False
The same works for a StatusBar object, e.g.:
StatusBarObject.SizingGrip = False
There is far more efficient answer: just put the following instructions in the Form_Load:
this.MinimumSize = new Size(Width, Height);
this.MaximumSize = this.MinimumSize;

MDI Windows with multiple MDIChields in different WindowState

I have a little problem with my MDI Parent Window and the MDI Childs window. The problem is that i need 3 child window but only the first it'll be maximize, so i use this code:
UserAdmin usrWindow = new UserAdmin();
usrWindow.MdiParent = this;
usrWindow.WindowState = FormWindowState.Normal;
usrWindow.Show();
For the others 2 windows i use this code:
TaskAdmin tskWindow = new TaskAdmin ();
tskWindow.MdiParent = this;
tskWindow.Show();
I only need that the first windows is maximized, but when i open the others they open maximized too.
How can i do to open one maximized and others in the default size over the first?
Thanks
That is not possible, yet can be achieved with very very tricky (using WndProc override, custom event loops) and ugly code which will not work in different operation systems in the same manner (i.e WinXP/WinXPSP1/WinXPSP3/Vista/Win7)
Your TaskAdmin forms cannot have an MDIParent in this situation. You need to either float these forms over the MDIParent or place them in panels in the MDIParent, docked to a side.

Categories