I'm using ModernUI for WPF (MUI) available on codeplex. It's a nice framework and I have no issues using it as a container for my pages.
I have added a Custom Dialog window but I do not want to use any of the default buttons.
In the init method I have commented out this line:
this.Buttons = new Button[] { this.OkButton, this.CancelButton };
But, a Close button appears instead?
Any ideas?
Thanks
Related
I need to add an output window to my windows form, similar to the output window in visual studio.
What i have done is created a list box and planning to log the details as and when they arrive. I dont know how to add the highlighted button controls (close, windows position, autohide). I am completely new to visual studio, winforms, c#. Just exploring various things to draft an application. I would be nice if anyone could suggest ideas in adding those controls.
And also please suggest if there is an alternative to list box to display the output window.
You can use SplitContainer and add Textbox or RichTextbox as output window you want. You can then append output text to the text property of Textbox ot RichTextbox. Instead of highlighted controls, you can change the size of SplitContainer at run time, or hide one of the section using menu option.
~Nilesh
Based on Sam W 's comment, Using DockPanel would create a another window inside the winform, similar to output, error window in Visual Studio IDE.
dockpanelsuite.com
This site provides amazing Docking Features http://docs.dockpanelsuite.com/ provides steps to install them.
In Form 1, set isMidiContainer = true in Form1's Properties and drag the DockPanel from toolBox(after installing and following steps in that page).
create a form2 and add the following
using WeifenLuo.WinFormsUI.Docking;
namespace Forms
{
public partial class Form2 : DockContent
{
public Form2()
{
InitializeComponent();
}
}
}
In Form1 add
public Form1()
{
InitializeComponent();
Form2 f2 = new Form2();
f2.Show(dockPanel, DockState.DockBottom);
}
We can add many more forms and dock them to one parent form.
How can you remove the titlebar and buttons in a UWP application? And always start in fullscreen. In WPF this is easy but can't find how to remove the buttons in UWP.
Tre below code in App.Xaml.cs (may be in onlaunched)
To remove the title bar.
CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
Window.Current.SetTitleBar(null);
To make it full screen (which also removes buttons)
ApplicationView view = ApplicationView.GetForCurrentView();
view.TryEnterFullScreenMode();
Need to import
using Windows.ApplicationModel.Core;
using Windows.UI.ViewManagement;
I want to create a ToolStripDropDownButton which looks like the below image
But when I tried to search for ToolStripDropDownButton control in the Toolbox I was unable to find it because, after some googling, I found out that it is a class not namespace.
Then I googled out the code below
ToolStripDropDownButton dropDownButton1 = new ToolStripDropDownButton();
ToolStripDropDown dropDown = new ToolStripDropDown();
dropDownButton1.Text = "A";
dropDownButton1.DropDown = dropDown;
dropDownButton1.Height = 200;
dropDownButton1.Width = 200;
Set the drop-down direction.
dropDownButton1.DropDownDirection = ToolStripDropDownDirection.Left;
// Do not show a drop-down arrow.
dropDownButton1.ShowDropDownArrow = false;
Controls.Add((Control)dropDownButton1); //Doesn't work
But the last line of code is not valid and gives runtime error
Cannot convert type 'System.Windows.Forms.ToolStripDropDownButton' to
'System.Windows.Forms.Control'
Can someone tell me how to add such a button in C# Windows Form or what am I missing in the code?
Platform : VS2008 Express (i know it's old)
The error message says that ToolStripDropDownButton is not a Control and thus, you can't add it to your form directly.
ToolStripDropDownButton and other tool strip items only work as a part of a ToolStrip. So, you need to put a toolstrip on your form, then you can add items to it.
Code example, if you want to do it programmatically:
ToolStrip toolStrip = new System.Windows.Forms.ToolStrip();
toolStrip.Items.Add(dropDownButton1);
Controls.Add(toolStrip);
It looks like your code comes from ShowDropDownArrow example on MSDN. Check out the complete code.
Also, you can do it in a form designer in Visual Studio. Look for ToolStrip in a toolbox.
Relevant links:
MSDN: How to: Create a Basic Windows Forms ToolStrip with Standard Items
Using the Designer
MSDN: How to: Add ToolStrip Items Dynamically
C# Corner: ToolStrip in C#
StackOverflow: Windows.Forms button with drop-down menu - discussion of alternative ways to implement this kind of control. One of the answers suggests to use a standalone ToolStrip.
I need to be able to make this kind of dialog box to be displayed when a button is pressed. I am using Acr.UserDialogs for simple dialog boxes but I don't think there is any way to get such a dialog using this library.
Any ideas on how I can do this in Xamarin Forms?
You can use the Popup plugin to display a page modally
You can create your own layout and use this awesome plugin to display your layout as popup
https://github.com/rotorgames/Rg.Plugins.Popup
How To Use --snippet from the link
Open new PopupPage
Task PushAsync(PopupPage page, bool animate = true) // Navigation.PushPopupAsync
Hide last PopupPage
Task PopAsync(bool animate = true) // Navigation.PopPopupAsync
I'd like add a button for changing window state to topmost to the built-in window buttons such as maximize, minimize, and close [please refer to this pic.]
However, I'm having hard time finding the way out as WPF seems not to provide such an API. I even thought using the icon next to the window title functioning as the button for topmost, but looks not feasible.
Is there anyway like using .dll or could I inherit the window class and add the button and corresponding event handler anyhow?
Thanks.
It will be very difficult as you can see below link:
How to add an extra button to the window's title bar?
To make things easy, you should consider implementing a custom window for that. This window will have custom buttons including Close,Minimize,Maximize along with any other buttons as well.