Click here to Skip to main content
6,292,811 members and growing! (11,337 online)
Email Password   helpLost your password?
Desktop Development » Miscellaneous » General     Intermediate

Firefox Option Dialog User Control for .NET Win Apps

By Rafey

Have your .NET Windows application cool Firefox option dialog with almost no effort. This user control is written in C# and could be used in any .NET complient language.
C#, Windows, .NET, Visual Studio, Dev
Posted:19 Jan 2007
Views:25,211
Bookmarked:54 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
10 votes for this article.
Popularity: 4.29 Rating: 4.29 out of 5
1 vote, 10.0%
1

2

3
2 votes, 20.0%
4
7 votes, 70.0%
5

ControlFirefoxDialog.jpg

Introduction

Firefox Dialog is a user control that you could easily add in your application with minimum coding to have a Firefox like options dialog in your .NET app. Control.FirefoxDialog is just 24kb with 72kb MozBar implementation (96kb total).

Background

Patrik Bohman has provided a great control named MozBar. While another C# Win App PagedDialog (unfortunately I don't remember the URL and author name) provided a basic property page implementation. What I was looking for is a combination of above two i.e a Firefox like Options dialog. I wish to that it requires almost no effort to add Firefox like options dialog in your application.

Using the Control

  • Compile Control.FirefoxDialog project to obtain DLL.
  • Create a Windows Application project and add a form Form1
  • Right click on Toolbox and click Choose Items...
  • Select/Browse for Control.FirefoxDialog.dll
  • In Toolbox look for FirefoxDialog Control and drag drop on Form1
  • Add a imageList imageList1 in Form1 and include one image for each tab.
  • Add a user control PageEmail derived from Control.FirefoxDialog.PropertyPage
  • Similarly add other pages/tabs user control
  • Now type following code in your Form1_Load

        private void Form1_Load(object sender, EventArgs e)
        {
            this.firefoxDialog1.ImageList = this.imageList1;

            this.firefoxDialog1.AddPage("Main", new PageMain());
            this.firefoxDialog1.AddPage("Email", new PageEmail());
            this.firefoxDialog1.AddPage("Internet", new PageInternet());
            this.firefoxDialog1.AddPage("Spell", new PageSpell());
            this.firefoxDialog1.AddPage("Favourites", new PageFav());

            this.firefoxDialog1.Init();
        }

This is it! Press F5 to run application. You could override following in your user controls:


namespace Demo
{
    public partial class PageEmail : Control.FirefoxDialog.PropertyPage
    {
        public PageEmail()
        {
            InitializeComponent();
        }

        public override void OnInit()
        {
            MessageBox.Show("PageEmail.OnInit Called.
Put your loading logic here.
Note that this method is called only Once!", "Control.FirefoxDialog");
        }

        public override void OnSetActive()
        {
            MessageBox.Show("PageEmail.OnSetActive Called.
Put code that you wish to call whenever Email tab become active.
Note that this method will be every time Email is activated!", "Control.FirefoxDialog");
        }

        public override void OnApply()
        {
            MessageBox.Show("PageEmail.OnApply Called.
Put your saving logic here.
It will be called when you hit Apply button.", "Control.FirefoxDialog");
        }
    }
}

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Rafey


Member
Software engineer developing solutions using Microsoft technologies.
Occupation: Web Developer
Location: Pakistan Pakistan

Other popular Miscellaneous articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 10 of 10 (Total in Forum: 10) (Refresh)FirstPrevNext
GeneralLicense PinmemberTeflon2:40 12 Oct '08  
GeneralExactly what I looked for PinmemberSven Grand6:25 22 Feb '08  
GeneralPagedDialog Pinmemberlogan133714:04 26 May '07  
QuestionScrolling PinmemberBrad Bruce6:54 25 Jan '07  
AnswerRe: Scrolling PinmemberRafey19:05 25 Jan '07  
GeneralVery useful for me PinmemberAxis231:36 25 Jan '07  
GeneralNice work! Pinmembertimothy_russell16:44 22 Jan '07  
GeneralRe: Nice work! PinmemberRafey19:16 22 Jan '07  
GeneralRe: Nice work! Pinmembertimothy_russell12:25 23 Jan '07  
GeneralRe: Nice work! Pinmembertimothy_russell16:35 23 Jan '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 19 Jan 2007
Editor:
Copyright 2007 by Rafey
Everything else Copyright © CodeProject, 1999-2009
Web13 | Advertise on the Code Project