Click here to Skip to main content
12,957,398 members (59,225 online)
Click here to Skip to main content
Add your own
alternative version


14 bookmarked
Posted 25 Feb 2006

Fast Dialogs and Message Boxes

, 13 Jun 2006 CPOL
Rate this:
Please Sign up or sign in to vote.
Some useful messageboxes and dialogs
Sample Image - FuliggineDialogs.png


How many times have you used the instruction: MessageBox.Show();? Well, this article explains how we can expand this feature of the framework for an immediate use of this function.

The Namespace

First of all, I divide the main namespace in three parts:

Fuliggine.Dialogs.Embedded; Embedded Dialogs like zoom form or find form
Fuliggine.Dialogs.Static; Static Dialogs like message box
Fuliggine.Dialogs.Dinamic; Customizable Dialogs (not yet implemented)

How To Use

First of all, add the using reference:

using Fuliggine;
using Fuliggine.Dialogs.Static;
using Fuliggine.Dialogs.Embedded;

To call a static Dialog, you need:

//Do a question
FuliggineBox.ShowQuestion("Sei Allergico al Gatto?");
//notify error
FuliggineBox.ShowError("Sei Allergico al Gatto.","ATTENTO");
//Show integer
int i= 15;
//Show an object or something unknown
FuliggineBox.ShowObject("Comments to print",this);

To see all ways to call those methods, take a look at the source code.
To call an embedded Dialog, you need to:

ZoomForm zf = new ZoomForm();

Source Code

For the FuliggineBox, I declare a static class where I call the method MessageBox.Show. With this, we can use custom message calling...


...instead of:

MessageBox.Show( Text ,"Question",MessageBoxButtons.YesNo, 
public class FuliggineBox
//Fuliggine Question
public static DialogResult ShowQuestion(string Text)
MessageBox.Show( Text ,"Question",MessageBoxButtons.YesNo,

For the embedded Dialogs, I use a Form that's equipped with all the needed controls and properties. For example, I show the code for the propertyDialog:

  1. I make a class derived from a Form
  2. I put the propertycontrol in the "form"
  3. I add a property called "Selectedobject"
namespace Fuliggine.Dialogs.Embedded
    public class ControlPropertyForm : System.Windows.Forms.Form
        private System.Windows.Forms.PropertyGrid propertyGrid1;
        //this property must be set before call( show some things)
        public object Selectedobject
            get{return this.propertyGrid1.SelectedObject;}
        public ControlPropertyForm()
            // The InitializeComponent() call is required for Windows Forms 
	   // designer support.
        #region Windows Forms Designer generated code       

And we will call these Dialogs as follows:

pf.Selectedobject=this;//Or something else...
pf.Show();//Or ShowDialog

At the End...

In the future, I will expand the number of embedded Dialogs adding - Font Dialog -Color Dialog - and every Dialog you need. I will also add the left class Fuliggine.Dialogs.Dinamics.

Framework Problematics

This code is written under Sharp Develop with framework 2. Sharp Develop is fully compatible with Visual Studio 2005, but if you use a different compiler/version of the framework, you only need to add the files in your solution and rebuild all.


This is only one of the possible solutions. Maybe it isn't the best one, but I think that it is simple and fast. For any advice, question or problem, please contact me. If you would like to see my other work, please visit my home page.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Daniele Fontani
Technical Lead
Italy Italy
I'm senior developer and architect specialized on portals, intranets, and others business applications. Particularly interested in Agile developing and open source projects, I worked on some of this as project manager and developer.

My programming experience include:

Frameworks \Technlogies: .NET Framework (C# & VB), ASP.NET, Java, php
Client languages:XML, HTML, CSS, JavaScript, angular.js, jQuery
Platforms:Sharepoint,Liferay, Drupal
Databases: MSSQL, ORACLE, MYSQL, Postgres

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 14 Jun 2006
Article Copyright 2006 by Daniele Fontani
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid