本文整理汇总了C#中System.Windows.Forms.ToolBarButtonClickEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ToolBarButtonClickEventArgs类的具体用法?C# ToolBarButtonClickEventArgs怎么用?C# ToolBarButtonClickEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolBarButtonClickEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了ToolBarButtonClickEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: tBar_ButtonClick
void tBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
{
OpenFileDialog f1;
SaveFileDialog f2;
switch (e.Button.ImageIndex)
{
case 0:
f1 = new OpenFileDialog();
if (f1.ShowDialog() == DialogResult.OK)
{
StreamReader r= File.OpenText(f1.FileName);
textBox1.Text = r.ReadToEnd();
}
break;
case 1:
f2 = new SaveFileDialog();
if (f2.ShowDialog() == DialogResult.OK)
{
StreamWriter w = new StreamWriter(f2.FileName);
w.WriteLine(textBox1.Text);
w.Close();
}
break;
case 2: Close(); break;
}
}
示例2: ToolBar1_ButtonClick
void ToolBar1_ButtonClick(object sender, ToolBarButtonClickEventArgs e) {
if (e.Button == ToolBarButtonFilter) {
entidadeList1.FilterVisible = ToolBarButtonFilter.Pushed;
ToolBarButtonNew.Pushed = false;
ToolBarButtonEdit.Pushed = false;
entidadeList1.DisableEdit();
} else {
if (e.Button == ToolBarButtonNew) {
entidadeList1.AddEntidadeMovimento();
} else if (e.Button == ToolBarButtonEdit) {
if (e.Button.Pushed) {
entidadeList1.EnableEdit();
} else {
entidadeList1.DisableEdit();
}
} else if (e.Button == ToolBarButtonDelete) {
var selectedEntity = entidadeList1.SelectedItems[0].Tag as GISADataset.MovimentoEntidadeRow;
if (CanDeleteEntity(selectedEntity))
entidadeList1.DeleteSelectedEntidade();
else
MessageBox.Show("Só é permitido apagar entidades requerentes que ainda não estejam associadas a requisições/devoluções.", "Eliminação de entidades requerentes", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
Model.PersistencyHelper.save();
Model.PersistencyHelper.cleanDeletedData();
}
UpdateEditGroup();
}
示例3: ProjectNewAction_ButtonClick
private void ProjectNewAction_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
{
if (e.Button == _button)
{
DoAction();
}
}
示例4: toolBar_ButtonClick
protected virtual void toolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
{
if (e.Button.Equals(tbOkButton))
resultButton.DialogResult = DialogResult.OK;
else resultButton.DialogResult = DialogResult.Cancel;
resultButton.raiseclick();
}
示例5: OnClicked
void OnClicked(object sender, ToolBarButtonClickEventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
if (dialog.ShowDialog(this) == DialogResult.OK) {
selectedFolder = dialog.SelectedPath;
statusbar.Text = selectedFolder;
}
}
示例6: Handle_ToolbarButtonClick
private void Handle_ToolbarButtonClick( object pComponent, ToolBarButtonClickEventArgs e )
{
if( m_Dictionary.Contains( e.Button ))
{
MenuCommand pMenuItem = (MenuCommand) m_Dictionary[ e.Button ];
if( pMenuItem != null )
pMenuItem.PerformClick( );
}
}
示例7: toolBar_ButtonClick
private void toolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e) {
string tag = (e.Button.Tag as string);
if (tag == null)
return;
switch (tag.ToLower()) {
case "clear":
if (onClear != null)
onClear();
break;
}
}
示例8: OnButtonClick
protected override void OnButtonClick(ToolBarButtonClickEventArgs e)
{
if (this.wholeDropDownButtons.Contains(e.Button))
{
// As the click event has fired for a whole dropdown we aren't
// running under Windows, so show it ourselves
this.ShowDropdownMenu(e.Button);
return;
}
base.OnButtonClick(e);
}
示例9: toolBar_ButtonClick
void toolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
{
if (e.Button == backButton)
{
shellView.NavigateBack();
}
else if (e.Button == forwardButton)
{
shellView.NavigateForward();
}
else if (e.Button == upButton)
{
shellView.NavigateParent();
}
}
示例10: toolBar_ButtonClick
private void toolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e) {
string tag = (e.Button.Tag as string);
if (tag == null)
return;
switch (tag.ToLower()) {
case "scaleup":
if (onScaleUp != null)
onScaleUp();
break;
case "scaledown":
if (onScaleDown != null)
onScaleDown();
break;
}
}
示例11: MainToolBar_ButtonClick
private void MainToolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
{
if (e.Button == toolBarButton1)
{
using(DatabaseConnectionDialog dialog = new DatabaseConnectionDialog())
{
DialogResult result = dialog.ShowDialog(Workspace.ActiveWindow);
if (result == DialogResult.OK)
{
IDatabaseDefinitionBuilder defBuilder =
ServiceRegistry.Instance[ typeof(IDatabaseDefinitionBuilder) ] as IDatabaseDefinitionBuilder;
DatabaseDefinition def = defBuilder.Build(dialog.Alias, dialog.ConnectionString);
Model.CurrentProject.AddDatabaseDefinition(def);
Model.Update();
}
}
}
}
示例12: controlBbar_ButtonClick
void controlBbar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
{
if (e.Button == _mainForm.TbbtnBack)
{
//_browser.Navigate(new Uri("http://georize.de:9494/demo/index.html"));
_browser.Navigate(new Uri("http://demo.krypsis.org/demo/index.html"));
}
else if (e.Button == _mainForm.TbbtnForward)
{
string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
CfgFile cfg = new CfgFile(path + "\\confini.ci");
string id = cfg.getValue("DATA", "uniqueid", true);
if (id == "") {
MessageBox.Show("---");
SecurityProvider sp = new SecurityProvider();
id = sp.GetUniqueIDWithTimestamp(32);
cfg.setValue("DATA", "uniqueid", id ,true);
cfg.Save();
}
MessageBox.Show(id);
}
else if (e.Button == _mainForm.TbbtnNew)
{
}
else if (e.Button == _mainForm.TbbtnSearch)
{
}
else if (e.Button == _mainForm.TbbtnShow)
{
}
else if (e.Button == _mainForm.TbbtnFavorites)
{
MessageBox.Show(DeviceInfo.GetSystemCountry()+" "+DeviceInfo.GetSysstemLanguage());
}
}
示例13: toolBarBrushType_ButtonClick
private void toolBarBrushType_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
{
// 设置Button按下状态
foreach (ToolBarButton button in toolBarBrushType.Buttons)
{
button.Pushed = (button == e.Button);
}
// 检测按钮按下状态,处理之
if (toolBarButtonPull.Pushed)
{
mEditTerrainHelper.DeformBrushType = 1;
}
else if (toolBarButtonSmooth.Pushed)
{
mEditTerrainHelper.DeformBrushType = 2;
}
else if (toolBarButtonNoise.Pushed)
{
mEditTerrainHelper.DeformBrushType = 3;
}
else if (toolBarButtonAverage.Pushed)
{
mEditTerrainHelper.DeformBrushType = 4;
}
else if (toolBarButtonFlat.Pushed)
{
mEditTerrainHelper.DeformBrushType = 5;
}
// 更新UI Panel
trackerBarWidgetOutterRadius.Value = Convert.ToDecimal(mEditTerrainHelper.DeformBrushOutterRadius);
trackerBarWidgetInnerRadius.Value = Convert.ToDecimal(mEditTerrainHelper.DeformBrushInnerRadius);
trackerBarWidgetBrushPower.Value = Convert.ToDecimal(mEditTerrainHelper.DeformBrushHardness);
trackerBarWidgetHeight.Value = Convert.ToDecimal(mEditTerrainHelper.DeformBrushHeight);
}
示例14: ToolBar_ButtonClick
void ToolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e) {
foreach (NodeTypeEntry nte in m_NodeTypes)
if (nte.Button == e.Button) {
var center = new Point();
var random = new Random(1);
var rect1 = gViewer.ClientRectangle; //gViewer.Graph.GeometryGraph.BoundingBox;
var rect2 = gViewer.Graph.BoundingBox;
Point p = gViewer.ScreenToSource(rect1.Location);
Point p2 = gViewer.ScreenToSource(rect1.Location + rect1.Size);
if (p.X < rect2.Left)
p.X = rect2.Left;
if (p2.X > rect2.Right)
p2.X = rect2.Right;
if (p.Y > rect2.Top)
p.Y = rect2.Top;
if (p2.Y < rect2.Bottom)
p2.Y = rect2.Bottom;
var rect = new Microsoft.Msagl.Core.Geometry.Rectangle(p, p2);
center.X = rect.Left + random.NextDouble()*rect.Width;
center.Y = rect.Bottom + random.NextDouble()*rect.Height;
}
}
示例15: chartToolBar_ButtonClick
private void chartToolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
{
if (e.Button == this.btnZoomIn)
this.ZoomIn();
if (e.Button == this.btnZoomOut)
this.ZoomOut();
if (e.Button == this.btnCrosshair)
this.Crosshair();
if (e.Button == this.btnCursor)
this.Pointer();
if (e.Button == this.btnLinear)
this.Linear();
if (e.Button == this.btnLog)
this.Log();
if (e.Button == this.btnCandle)
this.Candle();
if (e.Button == this.btnBar)
this.Bar();
if (e.Button == this.btnLine)
this.Line();
if (e.Button == this.btnWholeRange)
this.WholeRange();
if (e.Button == this.btnTrailing)
this.Trailing();
if (e.Button == this.btnFixed)
this.Fixed();
if (e.Button != this.btnPnF)
return;
this.PnF();
}