本文整理汇总了C#中System.Windows.Forms.Button类的典型用法代码示例。如果您正苦于以下问题:C# Button类的具体用法?C# Button怎么用?C# Button使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Button类属于System.Windows.Forms命名空间,在下文中一共展示了Button类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.listBox1 = new System.Windows.Forms.ListBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(32, 32);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(208, 23);
this.button1.TabIndex = 0;
this.button1.Text = "Call \"HelloWorld\" on remote object";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// listBox1
//
this.listBox1.Location = new System.Drawing.Point(32, 72);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(224, 95);
this.listBox1.TabIndex = 1;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.listBox1,
this.button1});
this.Name = "Form1";
this.Text = "RemoteObject";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
开发者ID:emtees,项目名称:old-code,代码行数:39,代码来源:Form1.cs
示例2: AddEventosABM
public static void AddEventosABM(Control grpCampos, ref Button btnGrabar, ref DataTable tbl)
{
tblTabla = tbl;
tblTabla.ColumnChanged += new DataColumnChangeEventHandler(HabilitarGrabar);
grabar = btnGrabar;
foreach (Control ctl in grpCampos.Controls)
{
if (ctl is TextBox)
{
ctl.Enter += new System.EventHandler(SelTextoTextBox);
ctl.KeyDown += new System.Windows.Forms.KeyEventHandler(EnterTab);
}
if (ctl is MaskedTextBox)
{
ctl.KeyDown += new System.Windows.Forms.KeyEventHandler(EnterTab);
}
}
foreach (Control ctl in grpCampos.Controls)
{
if (ctl is ComboBox)
{
ctl.KeyDown += new System.Windows.Forms.KeyEventHandler(EnterTab);
}
}
}
开发者ID:BenjaOtero,项目名称:trend-pos-factura,代码行数:25,代码来源:Utilitarios.cs
示例3: Initialize
public override void Initialize()
{
//txtLocation = new System.Windows.Forms.TextBox();
//txtLocation.Size = new System.Drawing.Size(238, 24);
//txtLocation.Top = 100;
//txtLocation.Left = 12;
//lblLocation = new System.Windows.Forms.Label();
//lblLocation.Size = new System.Drawing.Size(238, 24);
//lblLocation.Top = txtLocation.Top - 16;
//lblLocation.Left = txtLocation.Left;
//lblLocation.Text = "Location (eg: sim/x/y/z)";
cmdObjects = new System.Windows.Forms.Button();
cmdObjects.Size = new System.Drawing.Size(120, 24);
cmdObjects.Top = 100; cmdObjects.Left = 257;
cmdObjects.Text = "List Objects";
//cmdObjects.Click += new System.EventHandler(this.cmdObjects_OnClick);
cmdObjects.Click += (new frmObjects(instance)).Show();
//TabPage.Controls.Add(txtLocation);
//TabPage.Controls.Add(lblLocation);
TabPage.Controls.Add(cmdObjects);
}
开发者ID:NullProjects,项目名称:METAbolt,代码行数:25,代码来源:HeightmapInterface.cs
示例4: ToolbarPresenter
public ToolbarPresenter(Button utenteButton, Sessione sessione)
{
_utenteButton = utenteButton;
_utenteButton.Click += UtenteButton_click;
_sessione = sessione;
}
开发者ID:VforVentordici,项目名称:GameReViews,代码行数:7,代码来源:ToolbarPresenter.cs
示例5: TestShowWithEvents
public void TestShowWithEvents()
{
//---------------Set up test pack-------------------
System.Windows.Forms.DateTimePicker dateTimePicker = new System.Windows.Forms.DateTimePicker();
dateTimePicker.ShowCheckBox = true;
System.Windows.Forms.Form form = new System.Windows.Forms.Form();
System.Windows.Forms.TextBox textBox = new System.Windows.Forms.TextBox();
form.Controls.Add(textBox);
textBox.Dock = System.Windows.Forms.DockStyle.Fill;
textBox.Multiline = true;
form.Controls.Add(dateTimePicker);
dateTimePicker.Dock = System.Windows.Forms.DockStyle.Top;
dateTimePicker.ValueChanged += delegate
{
textBox.Text += "EventFired";
};
System.Windows.Forms.Button button = new System.Windows.Forms.Button();
form.Controls.Add(button);
button.Dock = System.Windows.Forms.DockStyle.Bottom;
button.Click += delegate
{
dateTimePicker.Checked = !dateTimePicker.Checked;
};
//-------------Assert Preconditions -------------
//---------------Execute Test ----------------------
form.ShowDialog();
//---------------Test Result -----------------------
}
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:30,代码来源:TestDateTimePickerWin.cs
示例6: InsertPInvokeSignaturesForm
public InsertPInvokeSignaturesForm()
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("PInvokeAddIn.Resources.InsertPInvokeSignaturesForm.xfrm"));
signatureRichTextBox = ((RichTextBox)ControlDictionary["SignatureRichTextBox"]);
// Hook up events.
closeButton = ((Button)ControlDictionary["CloseButton"]);
closeButton.Click += new EventHandler(CloseButtonClick);
insertButton = ((Button)ControlDictionary["InsertButton"]);
insertButton.Enabled = false;
insertButton.Click += new EventHandler(InsertButtonClick);
findButton = ((Button)ControlDictionary["FindButton"]);
findButton.Click += new EventHandler(FindButtonClick);
functionNameComboBox = ((ComboBox)ControlDictionary["FunctionNameComboBox"]);
functionNameComboBox.AutoCompleteMode = AutoCompleteMode.Suggest;
functionNameComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
moduleNameComboBox = ((ComboBox)ControlDictionary["ModuleNameComboBox"]);
moduleNameComboBox.AutoCompleteMode = AutoCompleteMode.Suggest;
moduleNameComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
moreInfoLinkLabel = ((LinkLabel)ControlDictionary["MoreInfoLinkLabel"]);
moreInfoLinkLabel.LinkClicked += new LinkLabelLinkClickedEventHandler(MoreInfoLinkClicked);
languageComboBox = ((ComboBox)ControlDictionary["LanguageComboBox"]);
languageComboBox.SelectedIndexChanged += new EventHandler(LanguageComboBoxSelectedIndexChanged);
SetupLanguages();
SetupFunctionNames();
SetupModuleNames();
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:35,代码来源:InsertPInvokeSignaturesForm.cs
示例7: InitializeComponent
private void InitializeComponent()
{
this.Text = "Excel Form";
this.StartPosition = FormStartPosition.CenterScreen;
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.ControlBox = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.BackColor = Color.Red;
btnOK = new Button();
btnOK.Text = "OK";
btnOK.Left = this.ClientRectangle.Width-btnOK.Width-10;
btnOK.Top = this.ClientRectangle.Height-btnOK.Height-10;
btnOK.Visible = true;
btnOK.Click += new EventHandler(btnOK_Click);
this.Controls.Add(btnOK);
btnCreate = new Button();
btnCreate.Text = "Create";
btnCreate.Left = this.ClientRectangle.Width - btnOK.Width - 150;
btnCreate.Top = this.ClientRectangle.Height - btnOK.Height - 10;
btnCreate.Visible = true;
btnCreate.Click += new EventHandler(btnCreate_Click);
this.Controls.Add(btnCreate);
}
开发者ID:dbremner,项目名称:hycs,代码行数:26,代码来源:excel_create.cs
示例8: BigBlockEdit_Load
private void BigBlockEdit_Load(object sender, EventArgs e)
{
curTileset = 0;
curVideo = 0x90;
curPallete = 0;
curPart = 0;
dirty = false;
updateSaveVisibility();
curViewType = MapViewType.Tiles;
initControls();
blocksPanel.Controls.Clear();
blocksPanel.SuspendLayout();
for (int i = 0; i < SMALL_BLOCKS_COUNT; i++)
{
var but = new Button();
but.FlatStyle = FlatStyle.Flat;
but.Size = new Size(32, 32);
but.ImageList = smallBlocks;
but.ImageIndex = i;
but.Margin = new Padding(0);
but.Padding = new Padding(0);
but.Click += new EventHandler(buttonObjClick);
blocksPanel.Controls.Add(but);
}
blocksPanel.ResumeLayout();
reloadLevel();
readOnly = false; //must be read from config
tbbSave.Enabled = !readOnly;
tbbImport.Enabled = !readOnly;
}
开发者ID:ghostdogtm,项目名称:CadEditor,代码行数:34,代码来源:BigBlockEdit.cs
示例9: RemoveAll
public static void RemoveAll(Control control)
{
if ((control != null) && (control.Controls.Count > 0))
{
Button tempButton = null;
Form parentForm = control.FindForm();
if (parentForm != null)
{
// Create a hidden, temporary button
tempButton = new Button();
tempButton.Visible = false;
// Add this temporary button to the parent form
parentForm.Controls.Add(tempButton);
// Must ensure that temp button is the active one
parentForm.ActiveControl = tempButton;
}
// Remove all entries from target
control.Controls.Clear();
if (parentForm != null)
{
// Remove the temporary button
tempButton.Dispose();
parentForm.Controls.Remove(tempButton);
}
}
}
开发者ID:krishnais,项目名称:ProfileSharp,代码行数:31,代码来源:ControlHelper.cs
示例10: Remove
public static void Remove(Control.ControlCollection coll, Control item)
{
if ((coll != null) && (item != null))
{
Button tempButton = null;
Form parentForm = item.FindForm();
if (parentForm != null)
{
// Create a hidden, temporary button
tempButton = new Button();
tempButton.Visible = false;
// Add this temporary button to the parent form
parentForm.Controls.Add(tempButton);
// Must ensure that temp button is the active one
parentForm.ActiveControl = tempButton;
}
// Remove our target control
coll.Remove(item);
if (parentForm != null)
{
// Remove the temporary button
tempButton.Dispose();
parentForm.Controls.Remove(tempButton);
}
}
}
开发者ID:krishnais,项目名称:ProfileSharp,代码行数:31,代码来源:ControlHelper.cs
示例11: AddRow
public void AddRow(String path, int rateNum)
{
var removeButton = new Button();
removeButton.Image = IconResource.remove_small;
removeButton.Size = addButton.Size;
removeButton.Tag = _pathButtons.Count;
removeButton.Click += OnRemove;
_removeButtons.Add(removeButton);
var pathButton = new Button();
pathButton.Text = path;
pathButton.Size = addPathButton.Size;
pathButton.Click += addPathButton_Click;
_pathButtons.Add(pathButton);
var rateComboBox = new ComboBox();
rateComboBox.Items.AddRange(_rates);
rateComboBox.SelectedIndex = Math.Min(rateNum, _rates.Length);
rateComboBox.Size = addRateComboBox.Size;
_rateComboBoxes.Add(rateComboBox);
int rowCount = _pathButtons.Count;
rowContainer.RowCount = rowCount;
rowContainer.Height = 28 * rowCount;
rowContainer.Controls.Add(removeButton, 0, rowCount - 1);
rowContainer.Controls.Add(pathButton, 1, rowCount - 1);
rowContainer.Controls.Add(rateComboBox, 2, rowCount - 1);
}
开发者ID:qedsyrt,项目名称:yotarif-win,代码行数:28,代码来源:RateProcessControl.cs
示例12: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnRun = new System.Windows.Forms.Button();
this.btnAbout = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// btnRun
//
this.btnRun.Location = new System.Drawing.Point(448, 56);
this.btnRun.Name = "btnRun";
this.btnRun.Size = new System.Drawing.Size(72, 23);
this.btnRun.TabIndex = 2;
this.btnRun.Text = "Run";
this.btnRun.Click += new System.EventHandler(this.btnRun_Click);
//
// btnAbout
//
this.btnAbout.Location = new System.Drawing.Point(528, 56);
this.btnAbout.Name = "btnAbout";
this.btnAbout.TabIndex = 3;
this.btnAbout.Text = "Close";
this.btnAbout.Click += new System.EventHandler(this.btnAbout_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.Location = new System.Drawing.Point(16, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(558, 18);
this.label1.TabIndex = 4;
this.label1.Text = "The sample demonstrates how to create percent stacked line chart in an excel work" +
"book.";
//
// checkBox1
//
this.checkBox1.Location = new System.Drawing.Point(24, 48);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(160, 24);
this.checkBox1.TabIndex = 5;
this.checkBox1.Text = "Stacked markers chart";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(616, 94);
this.Controls.Add(this.checkBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnAbout);
this.Controls.Add(this.btnRun);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Chart sample";
this.ResumeLayout(false);
}
开发者ID:spirecomponent,项目名称:.NETExcelLibrary,代码行数:64,代码来源:Form1.cs
示例13: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.txtLine = new System.Windows.Forms.TextBox();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(24, 18);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(72, 16);
this.label1.TabIndex = 0;
this.label1.Text = "Line Number";
//
// txtLine
//
this.txtLine.Location = new System.Drawing.Point(104, 16);
this.txtLine.Name = "txtLine";
this.txtLine.Size = new System.Drawing.Size(112, 20);
this.txtLine.TabIndex = 1;
this.txtLine.Text = "";
//
// btnOK
//
this.btnOK.Location = new System.Drawing.Point(240, 16);
this.btnOK.Name = "btnOK";
this.btnOK.TabIndex = 2;
this.btnOK.Text = "&OK";
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(240, 48);
this.btnCancel.Name = "btnCancel";
this.btnCancel.TabIndex = 3;
this.btnCancel.Text = "&Cancel";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// Goto
//
this.AcceptButton = this.btnOK;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(338, 87);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.txtLine);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Goto";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Go To";
this.ResumeLayout(false);
}
开发者ID:nguyenhuuhuy,项目名称:mygeneration,代码行数:64,代码来源:Goto.cs
示例14: ConstructorTest
public void ConstructorTest()
{
INuGenServiceProvider serviceProvider = new NuGenControlServiceProvider();
try
{
_sketchCanvas = new NuGenSketchCanvas((IntPtr)(-1), serviceProvider);
Assert.Fail();
}
catch (ArgumentException)
{
}
Button button = new Button();
button.CreateControl();
Assert.IsTrue(button.IsHandleCreated);
try
{
_sketchCanvas = new NuGenSketchCanvas(button.Handle, serviceProvider);
}
catch
{
Assert.Fail();
}
}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:25,代码来源:NuGenSketchCanvasTests.cs
示例15: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(56, 64);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(168, 80);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(64, 184);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(176, 20);
this.textBox1.TabIndex = 1;
this.textBox1.Text = "textBox1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.textBox1,
this.button1});
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
开发者ID:aleksey-zhidkov,项目名称:School-stuff,代码行数:38,代码来源:Form1.cs
示例16: ButtonCommandBinding
public ButtonCommandBinding(ICommand command, Button item)
{
this.command = command;
this.item = item;
this.Bind();
this.command.Refresh();
}
开发者ID:Waltervondehans,项目名称:NBi,代码行数:7,代码来源:ButtonCommandBinding.cs
示例17: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.btnBack = new System.Windows.Forms.Button();
this.btnNext = new System.Windows.Forms.Button();
this.Pick_Searches = new OGen.NTier.presentationlayer.winforms.ucPick_Searches();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btnBack
//
this.btnBack.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnBack.Location = new System.Drawing.Point(16, 248);
this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(72, 23);
this.btnBack.TabIndex = 9;
this.btnBack.Text = "<< &Back";
//
// btnNext
//
this.btnNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnNext.Location = new System.Drawing.Point(208, 248);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(72, 23);
this.btnNext.TabIndex = 8;
this.btnNext.Text = "&Next >>";
//
// Pick_Searches
//
this.Pick_Searches.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.Pick_Searches.Location = new System.Drawing.Point(8, 24);
this.Pick_Searches.Name = "Pick_Searches";
this.Pick_Searches.Size = new System.Drawing.Size(280, 216);
this.Pick_Searches.TabIndex = 10;
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.Location = new System.Drawing.Point(8, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(280, 23);
this.label1.TabIndex = 11;
this.label1.Text = "Choose Search:";
this.label1.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// frmManage_Updates_Create_step020
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(296, 277);
this.Controls.Add(this.label1);
this.Controls.Add(this.Pick_Searches);
this.Controls.Add(this.btnBack);
this.Controls.Add(this.btnNext);
this.Name = "frmManage_Updates_Create_step020";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Updates - Create";
this.ResumeLayout(false);
}
开发者ID:katshann,项目名称:ogen,代码行数:64,代码来源:frmManage_Updates_Create_step020.cs
示例18: InitialiseComponent
private void InitialiseComponent()
{
this.OKButton = new Button();
this.CancelButton = new Button();
this.UserInput = new TextBox();
//Form Properties
this.Size = new System.Drawing.Size(280, 160);
//OKButton Properties
this.OKButton.Location = new System.Drawing.Point(10, 60);
this.OKButton.Size = new System.Drawing.Size(120, 20);
this.OKButton.Click += new EventHandler(OKButtonClicked);
this.OKButton.Enabled = false; //unclickable until user inputs string in the search field
this.OKButton.Text = "Retrieve WebPage";
//CancelButton Properties
this.CancelButton.Location = new System.Drawing.Point(140, 60);
this.CancelButton.Size = new System.Drawing.Size(120,20);
this.CancelButton.Click+= new EventHandler(CancelButtonClicked);
this.CancelButton.Text = "Cancel";
//UserInput Properties
this.UserInput.Location = new System.Drawing.Point(0,0);//10,25
this.UserInput.TextChanged+=new EventHandler(UserInputTextChanged);
this.UserInput.Size = new System.Drawing.Size(230, 10);
//Controls
this.Controls.AddRange(new Control[] { this.OKButton, this.CancelButton, this.UserInput });
}
开发者ID:eklavyamirani,项目名称:WordNote,代码行数:30,代码来源:DialogBox.cs
示例19: cmdEvent_BeforeExecute
//they asked to pop up the Package Configurations dialog, so replace the Microsoft functionality so we can control the popup form
void cmdEvent_BeforeExecute(string Guid, int ID, object CustomIn, object CustomOut, ref bool CancelDefault)
{
if (Enabled)
{
try
{
if (this.ApplicationObject.ActiveWindow == null || this.ApplicationObject.ActiveWindow.ProjectItem == null) return;
ProjectItem pi = this.ApplicationObject.ActiveWindow.ProjectItem;
if (!pi.Name.ToLower().EndsWith(".dtsx")) return;
IDesignerHost designer = this.ApplicationObject.ActiveWindow.Object as IDesignerHost;
if (designer == null) return;
EditorWindow win = (EditorWindow)designer.GetService(typeof(Microsoft.DataWarehouse.ComponentModel.IComponentNavigator));
Package package = (Package)win.PropertiesLinkComponent;
this.packageForFixButton = package;
this.pathForPackageForFixButton = pi.get_FileNames(1);
DtsConfigurationsForm form = new DtsConfigurationsForm(package);
if (win.SelectedIndex == 0)
{
//control flow
EditorWindow.EditorView view = win.SelectedView;
System.Reflection.BindingFlags getflags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.DeclaredOnly | System.Reflection.BindingFlags.Instance;
Control viewControl = (Control)view.GetType().InvokeMember("ViewControl", getflags, null, view, null);
IWin32Window parentWin;
#if DENALI || SQL2014
parentWin = viewControl;
#else
DdsDiagramHostControl diagram = viewControl.Controls["panel1"].Controls["ddsDiagramHostControl1"] as DdsDiagramHostControl;
if (diagram == null || diagram.DDS == null) return;
parentWin = diagram.DDS;
#endif
Button editSelectedButton = (Button)form.Controls["editSelectedConfiguration"];
Control packageConfigurationsGridControl1 = form.Controls["packageConfigurationsGridControl1"];
Button btnRelativePaths = new Button();
btnRelativePaths.Text = "Fix All Relative Paths";
btnRelativePaths.Width = 140;
btnRelativePaths.Left = packageConfigurationsGridControl1.Left;
btnRelativePaths.Top = editSelectedButton.Top;
btnRelativePaths.Height = editSelectedButton.Height;
btnRelativePaths.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
btnRelativePaths.Click += new EventHandler(btnRelativePaths_Click);
form.Controls.Add(btnRelativePaths);
if (DesignUtils.ShowDialog((Form)form, parentWin, (IServiceProvider)package.Site) == DialogResult.OK)
{
SSISHelpers.MarkPackageDirty(package);
}
CancelDefault = true;
}
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
}
}
}
开发者ID:japj,项目名称:bidshelper,代码行数:61,代码来源:RelativePathsPlugin.cs
示例20: FlatButtonAppearanceExceptionTest
public void FlatButtonAppearanceExceptionTest ()
{
Button B1 = new Button ();
FlatButtonAppearance flatApp = B1.FlatAppearance;
flatApp.BorderSize = -1;
}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:7,代码来源:ButtonTest.cs
注:本文中的System.Windows.Forms.Button类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论