Click here to Skip to main content
Licence CPOL
First Posted 19 Jan 2007
Views 47,283
Downloads 582
Bookmarked 78 times

Firefox Option Dialog User Control for .NET Win Apps

By | 19 Jan 2007 | Article
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 compliant language.
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 the above two, i.e., a Firefox like Options dialog. I wish too 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 an 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 the 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 the application. You could override the 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()
        {
            MessagBox.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");
        }
    }
}

History

  • 19th January, 2007: Initial post

License

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

About the Author

Rafey

Web Developer

Pakistan Pakistan

Member

Software engineer developing solutions using Microsoft technologies.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Generalbug...Apply click ...when call from Form.ShowDialog()... Pinmember_Kay_21:37 7 Jun '11  
GeneralRe: OK...I solved. Pinmember_Kay_22:42 7 Jun '11  
GeneralAuthor and link for PagedDialog PinmemberDaniel C.13:41 12 Nov '09  
Generaljump from one page to another Pinmemberbkaratte5:36 22 Jul '09  
GeneralLicense PinmemberTeflon1:40 12 Oct '08  
GeneralExactly what I looked for PinmemberSven Grand5:25 22 Feb '08  
GeneralPagedDialog Pinmemberlogan133713:04 26 May '07  
GeneralRe: PagedDialog Pinmembernguyenphuphi7:07 6 Jul '09  
QuestionScrolling PinmemberBrad Bruce5:54 25 Jan '07  
AnswerRe: Scrolling PinmemberRafey18:05 25 Jan '07  
Thank you Brad. Firefox 2.0 options pages do not have scrollbars. However you could have scrollbar turned on for various controls:
 
1. Place textbox, listbox, DataGrid, DataGridView etc. on your form.
 
2. Make sure correct properties Multiline, Scrollbars(Both) etc. are set for these control.
 

 
Smile you will look better Smile | :)

GeneralVery useful for me PinmemberAxis230:36 25 Jan '07  
GeneralNice work! Pinmembertimothy_russell15:44 22 Jan '07  
GeneralRe: Nice work! PinmemberRafey18:16 22 Jan '07  
GeneralRe: Nice work! Pinmembertimothy_russell11:25 23 Jan '07  
GeneralRe: Nice work! Pinmembertimothy_russell15:35 23 Jan '07  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120529.1 | Last Updated 19 Jan 2007
Article Copyright 2007 by Rafey
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid