|
// Copyright � 2006 by Christoph Richner. All rights are reserved.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
// website http://www.raccoom.net, email support@raccoom.net, msn chrisdarebell@msn.com
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Raccoom.Windows.Forms
{
/// <summary>
/// FavouriteUrlEditInputBox belongs to a set of dialogs that are Internet Explorer Favorite clones.
/// </summary>
public class FavoritesNewFolderDialog : System.Windows.Forms.Form
{
#region fields
private System.Windows.Forms.Button _pbCancel;
private System.Windows.Forms.Button _pbOK;
private System.Windows.Forms.TextBox _textDesc;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
#endregion
public FavoritesNewFolderDialog()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
#region public interface
public string Title
{
get
{
return _textDesc.Text;
}
}
#endregion
#region events
protected override void OnLoad(EventArgs e)
{
base.OnLoad (e);
//
this.label2.Text = string.Format(label2.Text,this.ProductName);
}
/// <summary>
/// Fired if description text changed, used to enable ok button if text length greater 0.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnDescTextChanged(object sender, System.EventArgs e)
{
this._pbOK.Enabled = _textDesc.Text.Length>0;
}
#endregion
#region Windows Form Designer generated code
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this._pbCancel = new System.Windows.Forms.Button();
this._pbOK = new System.Windows.Forms.Button();
this._textDesc = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// _pbCancel
//
this._pbCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this._pbCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
this._pbCancel.Location = new System.Drawing.Point(256, 104);
this._pbCancel.Name = "_pbCancel";
this._pbCancel.TabIndex = 2;
this._pbCancel.Text = "&Cancel";
//
// _pbOK
//
this._pbOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this._pbOK.Enabled = false;
this._pbOK.FlatStyle = System.Windows.Forms.FlatStyle.System;
this._pbOK.Location = new System.Drawing.Point(168, 104);
this._pbOK.Name = "_pbOK";
this._pbOK.TabIndex = 1;
this._pbOK.Text = "&OK";
//
// _textDesc
//
this._textDesc.Location = new System.Drawing.Point(80, 64);
this._textDesc.Name = "_textDesc";
this._textDesc.Size = new System.Drawing.Size(246, 20);
this._textDesc.TabIndex = 0;
this._textDesc.Text = "";
this._textDesc.TextChanged += new System.EventHandler(this.OnDescTextChanged);
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 64);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 25);
this.label1.TabIndex = 8;
this.label1.Text = "Name:";
//
// label2
//
this.label2.Location = new System.Drawing.Point(8, 16);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(328, 32);
this.label2.TabIndex = 9;
this.label2.Text = "{0} will create the following folder for you. You can use this folder to organize" +
" shortcuts on your Favorite menu.";
//
// FavoritesNewFolderDialog
//
this.AcceptButton = this._pbOK;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.CancelButton = this._pbCancel;
this.ClientSize = new System.Drawing.Size(336, 134);
this.Controls.Add(this.label2);
this.Controls.Add(this._textDesc);
this.Controls.Add(this.label1);
this.Controls.Add(this._pbCancel);
this.Controls.Add(this._pbOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FavoritesNewFolderDialog";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "FavouriteUrlEditInputBox";
this.ResumeLayout(false);
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.