本文整理汇总了C#中Button.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Button.Show方法的具体用法?C# Button.Show怎么用?C# Button.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Button
的用法示例。
在下文中一共展示了Button.Show方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main ()
{
Gtk.Application.Init ();
file = FileFactory.NewForUri (new Uri ("smb://[email protected]/myshare/test"));
Window w = new Window ("test");
operation = new Gtk.MountOperation (w);
Button b = new Button ("Mount");
b.Clicked += new System.EventHandler (HandleButtonClicked);
b.Show ();
w.Add (b);
w.Show ();
Gtk.Application.Run ();
}
示例2: Prep
public void Prep(VenObj V)
{
creator = V;
this.buyButton.Enabled = false;
this.Controls.Remove(buyButton);
vennameLabel.Text = V.VenueName;
ressampButton.ForeColor = Color.Red;
ressampButton.BackColor = Color.DarkRed;
opensampButton.ForeColor = Color.Green;
stagesampButton.BackColor = Color.Yellow;
foreach (instaSeat b in V.SeatLayout)
{
if (b.DSP != "Stage")
{
Button a = new Button();
a.Size = b.S;
a.Location = b.P;
a.Text = b.DSP;
a.Show();
this.Controls.Add(a);
a.Click += instaButton_Click;
}
else
{
Button s = new Button();
s.Size = b.S;
s.Location = b.P;
s.Text = "Stage";
s.Enabled = false;
s.BackColor = Color.Yellow;
this.Controls.Add(s);
s.Show();
}
}
}
示例3: MakeBox
static HBox MakeBox(bool homogeneous, int spacing, bool expand,
bool fill, uint padding)
{
var box = new HBox(homogeneous, spacing);
var button = new Button("gtk_box_pack");
box.PackStart(button, expand, fill, padding);
button.Show();
button = new Button("(box,");
box.PackStart(button, expand, fill, padding);
button.Show();
button = new Button("button");
box.PackStart(button, expand, fill, padding);
button.Show();
if(expand == true) {
button = new Button("TRUE");
}
else {
button = new Button("FALSE");
}
box.PackStart(button, expand, fill, padding);
button.Show();
button = new Button(fill ? "TRUE," : "FALSE,");
box.PackStart(button, expand, fill, padding);
button.Show();
var padstr = padding.ToString() + ");";
button = new Button(padstr);
box.PackStart(button, expand, fill, padding);
button.Show();
return box;
}
示例4: NotificationWidget
public NotificationWidget()
: base()
{
HBox box = new HBox ();
label = new Label ();
label.Xalign = 0;
closeButton = new Button ();
closeButton.Image =
new Image (Stock.Close,
IconSize.Button);
closeButton.Clicked += on_close;
acceptButton = new Button (Stock.Ok);
acceptButton.Image =
new Image (Stock.Ok, IconSize.Button);
acceptButton.Clicked += on_accept;
ModifyBg (StateType.Normal,
new Gdk.Color (0xff, 0xff, 0xc0));
box.PackStart (label, true, true, 5);
box.PackStart (acceptButton, false, false,
5);
box.PackStart (closeButton, false, false,
5);
label.Show ();
closeButton.Show ();
// This box will add some vertical padding
VBox b = new VBox ();
b.PackStart (box, false, true, 5);
Add (b);
}
示例5: CreateButtons
private void CreateButtons()
{
try
{
foreach (FieldInfo fI in typeof(Protocols).GetFields())
{
if (fI.Name != "value__" && fI.Name != "NONE" && fI.Name != "IntApp")
{
Button nBtn = new Button();
nBtn.Text = fI.Name;
nBtn.FlatStyle = FlatStyle.Flat;
nBtn.Size = new Size(60, 40);
nBtn.Parent = this.flpProtocols;
nBtn.Click += new System.EventHandler(ProtocolButton_Click);
nBtn.Show();
}
}
}
catch (Exception ex)
{
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
(string)
("CreateButtons (UI.Window.QuickConnect) failed" +
Constants.vbNewLine + ex.Message), true);
}
}
示例6: test
public test()
{
Text = "TestHellO!!!";
Size = new Size(500,400);
CenterToScreen();
tb_request = new TextBox();
tb_request.Size = new Size(400,0);
tb_request.Parent = this;
Button b = new Button();
b.Text = "Auth";
b.Click += new EventHandler(cl);
b.Parent = this;
b.Show();
b.Location = new Point(0,25);
this.Controls.Add(b);
response_box = new TextBox();
response_box.Multiline = true;
response_box.Location = new Point(220,50);
response_box.Size = new Size(200,200);
response_box.Parent = this;
// otvet = new TextBox();
// otvet.Location = new Point(220,50);
// otvet.Multiline = true;
// otvet.Size = new Size(200,200);
// otvet.ScrollBars = ScrollBars.Both;
// otvet.Parent = this;
// otvet = new ListBox();
// otvet.Location = new Point(0,50);
// otvet.Size = new Size(200,200);
// otvet.Click += new EventHandler(otvet_click);
// otvet.Parent = this;
lv = new ListView();
lv.Location = new Point(0,50);
lv.Size = new Size(200,200);
lv.Columns.Add("test");
lv.Columns.Add("test2");
lv.GridLines = true;
lv.View = View.Details;
lv.Click += new EventHandler(otvet_click);
lv.Parent = this;
label = new Label();
label.Location = new Point(240,0);
label.Parent = this;
}
示例7: AddScreenshot
public void AddScreenshot(Image Screenshot)
{
try
{
PictureBox nPB = new PictureBox();
nPB.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbScreenshot_MouseDown);
nPB.Parent = this.flpScreenshots;
nPB.SizeMode = PictureBoxSizeMode.StretchImage;
nPB.BorderStyle = BorderStyle.FixedSingle;
nPB.ContextMenuStrip = this.cMenScreenshot;
nPB.Image = Screenshot;
nPB.Size = new Size(100, 100);
//New Size((Screenshot.Width / 100) * 20, (Screenshot.Height / 100) * 20)
nPB.Show();
Button nBtn = new Button();
nBtn.Click += new System.EventHandler(btnCloseScreenshot_Click);
nBtn.Parent = nPB;
nBtn.FlatStyle = FlatStyle.Flat;
nBtn.Text = "×";
nBtn.Size = new Size(22, 22);
nBtn.Location = new Point(nPB.Width - nBtn.Width, -1);
nBtn.Show();
this.Show(frmMain.Default.pnlDock);
}
catch (Exception ex)
{
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
(string)
("AddScreenshot (UI.Window.ScreenshotManager) failed" +
Constants.vbNewLine + ex.Message), true);
}
}
示例8: Button_Click
private void Button_Click(object sender, RoutedEventArgs e)
{
Button window = new Button();
window.Show();
}
示例9: Main
private static int Main(string[] args)
{
// * Init GTK.
Gtk.Application.Init ("Color", ref args);
// * Init GtkGLExt.
GtkGL.Application.Init (ref args);
// * Display mode.
GdkGL.ConfigMode mode = GdkGL.ConfigMode.Index;
for (int i = 0; i < args.Length; i++)
{
if (args[i] == "--rgb")
mode = GdkGL.ConfigMode.Rgb;
}
// * Query OpenGL extension version.
int major, minor;
Query.Version (out major, out minor);
Console.WriteLine ("\nOpenGL extension version - {0}.{1}", major, minor);
// * Configure OpenGL-capable visual.
// Try double-buffered visual
GdkGL.Config glconfig = new GdkGL.Config (mode | GdkGL.ConfigMode.Depth | GdkGL.ConfigMode.Double);
if (glconfig == null) {
Console.WriteLine ("*** Cannot find the double-buffered visual.\n*** Trying single-buffered visual.");
glconfig = new GdkGL.Config (mode | GdkGL.ConfigMode.Depth);
if (glconfig == null) {
Console.WriteLine ("*** Cannot find any OpenGL-capable visual.");
return 1;
}
}
GlUtilities.WriteOutConfig (glconfig);
bool is_rgba = glconfig.IsRgba;
// Top-level window.
Window window = new Window (WindowType.Toplevel);
window.Title = "color";
// Perform the resizes immediately
window.ResizeMode = ResizeMode.Immediate;
// Get automatically redrawn if any of their children changed allocation.
window.ReallocateRedraws = true;
window.DeleteEvent += new DeleteEventHandler (Window_Delete);
// VBox.
VBox vbox = new VBox (false, 0);
window.Add (vbox);
vbox.Show ();
// Drawing area for drawing OpenGL scene.
ColorTriangle drawing_area = new ColorTriangle (glconfig);
drawing_area.SetSizeRequest (200, 200);
vbox.PackStart (drawing_area, true, true, 0);
drawing_area.Show ();
// Simple quit button.
Button button = new Button ("Quit");
button.Pressed += new EventHandler (Button_Click);
vbox.PackStart (button, false, false, 0);
button.Show ();
// * Show window.
window.Show ();
// * Allocate colors.
if (!is_rgba) {
Gdk.Colormap colormap = glconfig.Colormap;
Console.WriteLine ("\nAllocate colors.");
// Allocate writable color cells.
bool[] success = new bool [NUM_COLORS];
int not_allocated = colormap.AllocColors (colors, NUM_COLORS, false, false, success);
for (int i = 0; i < NUM_COLORS; i++)
Console.WriteLine ("{0}", success[i]);
Console.WriteLine ("Not allocated = {0}", not_allocated);
for (int i = 0; i < NUM_COLORS; i++)
Console.WriteLine ("colors[{0}] = [ {1}, {2}, {3}, {4} ]", i,
colors[i].Pixel,
colors[i].Red,
colors[i].Green,
colors[i].Blue
);
Console.WriteLine ("\nQuery colors.");
for (int i = 0; i < NUM_COLORS; i++) {
Gdk.Color color = new Gdk.Color ();
color.Pixel = colors[i].Pixel;
colormap.QueryColor (colors[i].Pixel, ref color);
Console.WriteLine ("colors[{0}] = { {1}, {2}, {3}, {4} }", i,
colors[i].Pixel,
color.Red,
color.Green,
//.........这里部分代码省略.........
示例10: Main
public static int Main(string[] args)
{
/*
* Init GTK.
*/
Gtk.Application.Init (/*"Gears3D", null*/);
/*
* Init GtkGLExt.
*/
GtkGL.Application.Init (ref args);
/*
* Command line options.
*/
for (int i = 0; i < args.Length; i++)
if (args[i] == "--async")
is_sync = false;
/*
* Configure OpenGL-capable visual.
*/
/* Try double-buffered visual */
GdkGL.Config glconfig = new GdkGL.Config (GdkGL.ConfigMode.Rgb | GdkGL.ConfigMode.Depth | GdkGL.ConfigMode.Double);
if (glconfig == null) {
Console.WriteLine ("*** Cannot find the double-buffered visual.\n*** Trying single-buffered visual.");
/* Try single-buffered visual */
glconfig = new GdkGL.Config (GdkGL.ConfigMode.Rgb | GdkGL.ConfigMode.Depth);
if (glconfig == null) {
Console.WriteLine ("*** Cannot find any OpenGL-capable visual.");
return 1;
}
}
/*
* Top-level window.
*/
Window window = new Window (WindowType.Toplevel);
window.Title = "gears";
/* Get automatically redrawn if any of their children changed allocation. */
window.ReallocateRedraws = true;
window.DeleteEvent += new DeleteEventHandler (Window_Delete);
/*
* VBox.
*/
VBox vbox = new VBox (false, 0);
window.Add (vbox);
vbox.Show ();
/*
* Drawing area for drawing OpenGL scene.
*/
/* Set OpenGL-capability to the widget. */
GearsArea drawing_area = new GearsArea (glconfig);
drawing_area.SetSizeRequest (300, 300);
window.KeyPressEvent += new KeyPressEventHandler (drawing_area.OnKeyPress);
vbox.PackStart (drawing_area, true, true, 0);
drawing_area.Show ();
/*
* Simple quit button.
*/
Button button = new Button ("Quit");
button.Clicked += new EventHandler (Button_Click);
vbox.PackStart (button, false, false, 0);
button.Show ();
/*
* Show window.
*/
window.Show ();
/*
* Main loop.
*/
Gtk.Application.Run ();
return 0;
}
示例11: Form1
public Form1()
{
InitializeComponent();
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.StartPosition = FormStartPosition.CenterScreen;
SQLite = new SQLite(); // DB Object
cmd = SQLite.GetSQLCommand(); // Command Object
currentCategory = "Week";
button1.Visible = true;
button2.Visible = false;
dateTimePicker1.CloseUp += DateTimePicker1_CloseUp;
neoTabWindow1.Renderer = NeoTabControlLibrary.AddInRendererManager.LoadRenderer("MarginBlueRendererVS2");
neoTabWindow1.BackColor = Color.White;
imgBtnContainer1.BackColor = Color.White;
imgBtnContainer2.BackColor = Color.White;
button1.Click += Button1_Click;
panel5.BackColor = Color.LightGray;
panel2.BackColor = Color.LightGray;
// Budget
B_IncomeTab = new NeoTabPage();
B_SpendTab = new NeoTabPage();
B_IncomeTab.Text = "수입 예산";
B_SpendTab.Text = "지출 예산";
BIp = new Budget(Budget.DMode.income, dateTimePicker1, DateTime.Now);
BIp.SetLabel();
BIp.Dock = DockStyle.Fill;
BIp.SetDate(dateTimePicker1.Value);
BSp = new Budget(Budget.DMode.spend, dateTimePicker1, DateTime.Now);
BSp.SetLabel();
BSp.Dock = DockStyle.Fill;
BSp.SetDate(dateTimePicker1.Value);
B_IncomeTab.Controls.Add(BIp);
B_SpendTab.Controls.Add(BSp);
// Week
W_IncomeTab = new NeoTabPage();
W_SpendingTab = new NeoTabPage();
// 버튼 선언
reportBtn = new Button();
incomeBtn = new Button();
spendBtn = new Button();
detailBtn = new Button();
// 버튼 세팅
reportBtn.Size = new Size(107, 40);
reportBtn.Location = new Point(843, 6);
reportBtn.Text = "인쇄";
reportBtn.Font = button1.Font;
incomeBtn.Size = new Size(107, 40);
incomeBtn.Location = new Point(843, 6);
incomeBtn.Text = "인쇄";
incomeBtn.Font = button1.Font;
spendBtn.Size = new Size(107, 40);
spendBtn.Location = new Point(843, 6);
spendBtn.Text = "인쇄";
spendBtn.Font = button1.Font;
detailBtn.Size = new Size(107, 40);
detailBtn.Location = new Point(843, 6);
detailBtn.Text = "인쇄";
detailBtn.Font = button1.Font;
panel1.Controls.Add(reportBtn);
panel1.Controls.Add(incomeBtn);
panel1.Controls.Add(spendBtn);
panel1.Controls.Add(detailBtn);
reportBtn.Show();
incomeBtn.Hide();
spendBtn.Hide();
detailBtn.Hide();
// 월별 탭
M_ReportTab = new NeoTabPage();
M_ReportTab.Text = "재정 보고";
sr = new SpendReport(SpendReport.DMode.Month, reportBtn);
sr.SetDate(dateTimePicker1.Value);
sr.Validate();
sr.Dock = DockStyle.Fill;
M_ReportTab.Controls.Add(sr);
M_IncomeTab = new NeoTabPage();
M_IncomeTab.Text = "재정 수입";
ip = new IncomeProgress(IncomeProgress.DMode.income, incomeBtn);
ip.Dock = DockStyle.Fill;
M_IncomeTab.Controls.Add(ip);
M_SpendingTab = new NeoTabPage();
M_SpendingTab.Text = "재정 지출";
sp = new IncomeProgress(IncomeProgress.DMode.spend, spendBtn);
ip.Dock = DockStyle.Fill;
//.........这里部分代码省略.........