Question about changing dialog box layout - winforms

Hey, I just got started designing dialog boxes and windows forms, and I had a basic question.
When you use something like a windows installer, it has a next button, and when you click it the dialog completely changes layout in moving on to the next step. My question is, is this done by loading a completely new dialog box and getting rid of the previous one. Or is there some way of making a dialog with multiple pages/states (not sure what to call them).
Thanks in advance for any help.

Wizards are usually made using the property sheet control from the Common Controls library. They do not create a new dialog, but use something similar to tab pages instead.

Related

After adding a tab control and copying and pasting the text fields + buttons into a tab my windows form no longer works

I'm a C# noobie and have recently made a CRUD app with windows forms and decided to upgrade it a little by adding a tab function to add new functionalities to it but after copying and pasting the design of my windows form into the TabControl field, the design shows up but the CRUD system itself no long works.
I feel like I might need to call the TabControl in the form design code but have no idea how I'd do that. All of my CRUD code was made directly on the WinForm design class.
As #Idle_Mind mentioned in the comments, after pasting controls into the new tab all the events wired to them were wiped. After rewiring them the problem was solved!

Windows 8 like modal dialog using WPF

I am working on a WPF-MVVM (.Net 4.0) application that has a Metro look (it just has a look, it is not a metro application.)
I need to show a windows 8 like message box that blocks the operations for the user before he rids that message box by clicking yes/no/cancel (or any button.).
I came across this otherwise great article and momentarily thought that I have found the solution. But this has its own drawback.It just stops the user from interacting with the controls behind by mouse clicks. The user can however use the tab key to get back to the buttons behind and click them (pressing enter).
A number of things are coming to my mind:
should I go for custom adorners and play with hitTestable property?
Or should I place a control and play with its visible property.
Before going for any approach I thought of putting forward my question to the wonderful community here if someone has done a similar thing in past and provide me some pointer/reference/approach.
Can someone suggest what is the way to achieve this? Please note I will be happy to use prism or any other open source if that solves the purpose but the window will have to be custom made.
Please excuse me if you find this too stupid a question. Please pardon my ignorance. Thanks for reading this.
I recently came across a similar problem, I resolved it using a DialogPresenter as explained there:
http://www.codeproject.com/Articles/36516/WPF-Modal-Dialog
I had to do a few tweaks there and there but overall it's working fine and I now have a nice way to display dialog boxes!
There is a better way of doing it
var dialog = new MessageDialog("Select Social network is already authorised!");
dialog.ShowAsync();

WPF button enable/disable problem

I'm somewhat new to WPF and VB.Net (but not new to programming in general) and I was wondering if someone could help me with an issue that I'm having.
Here's the problem:
I am creating a simple form using WPF in VB.Net and I have a button that I want to disable or enable based on an update to a DataGrid that is located in the form. When I first show the form the button is enabled by default and everything is fine. When the DataGrid changes I can disable the button programmatically by doing btnTest.IsEnabled=False and the button grays out appropriately. However, when I subsequently call btnTest.IsEnabled=True the button becomes enabled all except for the text that is displayed on the button; that text remains grayed out. I can switch back and forth between enabled and disabled several times and the behavior described still manifests. I'm not sure if I'm missing something but this seems to be a really simple problem to me and I've wasted a few hours on it already.
Does anyone know what's going on? I've already googled everything I know.
Thanks
Tom
Just to update this: I actually found out that this was a bug in the BureauBlue theme that ships with .NET. If you have this problem tag me in a comment here and I can send you my modified BureauBlue.xaml file.

Toolbar Button with Context Menu? Like New Project Button in Visual Studio

I need a toolbar button similiar to the "New Project" button in the standard Visual Studio toolbar. When clicked, it pops up a dialog. However, it also has a small little down-arrow next to the icon graphic that, when clicked, expands a context menu with more options.
Is there a standard control available with this functionality?
I don't think there's built in functionality for a SplitButton in WPF currently. Here's another thread that may help you out though:
WPF SplitButton?
You could combine a couple of controls together to make one fairly quickly. Might as well make a new UserContol out of it that can be re-used throughout your app as well.
Also, a quick search on WPF SplitButton will return a lot of examples on how to make one or you could get one off of CodeProject or CodePlex (though I'm not sure if they'll come with a image property automatically).

Winforms application menu and application UI

I am working on a little WinForm app and have been trying to find the answers to a few questions i have without any luck. Im a ASP.NET developer so WinForms development is new to me.
Here is my main question:
How do I create a menu system that once selected the contents will render in the Main form of the selected item. If its a GridView I want to the GridView to render inside the main application so they can navigate away without having to deal with the modal popup. I do not want to popup forms unless i explicitly say so. I guess the equivalent to this would be using a Master page in ASP.NET.
Make sense?
The closest thing to Master pages in winforms would be MDI (multiple document interface), which is a hideous Windows 3.1-era abortion of a user interface. Why this option is even still around, and why anyone still uses it, is beyond me.
The second closest thing (and something more acceptable as a UI) is just to have one main form in your application, and implement the different pieces of functionality your app requires as separate user controls which are displayed on the form and hidden as the context requires.
A weirder method, but one that might also work for you, is to use forms inheritance - design one "master" form with the menus and controls that you want to always be present, and then have each form in your app inherit from that master form. This would not appear to the user to be much different from my second option above, so I wouldn't bother with it.
There really isn't anything similar to Master pages in WinForms.
The closest to what you want to use would be a TabControl selecting a different tab will display that tab over the other tabs. If you don't like the tab look you could extend the TabControl to not show the tabs or hack it together by placing the TabControl inside a panel just large enough to show the content but not the Tabs and change tabs programatically in your menu control.

Resources