forked from SMAH1/smah1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpliteButtonTestForm.cs
More file actions
116 lines (96 loc) · 4.05 KB
/
SpliteButtonTestForm.cs
File metadata and controls
116 lines (96 loc) · 4.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
/*
* in this develop use article and code of:
* CodeProject : SplitButton a .NET WinForm control, Part 1
* Address : http://www.codeproject.com/Articles/18447/SplitButton-a-NET-WinForm-control-Part-1
* Author : Avi Farah
*/
namespace HowToWork
{
public partial class SpliteButtonTestForm : Form
{
public SpliteButtonTestForm()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
splitButton1.AddDropDownItemAndHandle("Test 1", Test1Handler);
splitButton1.AddDropDownItemAndHandle("Testing Testing", Testing2Handler);
splitButton1.AddDropDownItemAndHandle("Testing testing testing", Testing3Handle);
AlwaysDropDown.DataBindings.Add("Checked", splitButton1, "AlwaysDropDown");
AlwaysHoverChange.DataBindings.Add("Checked", splitButton1, "AlwaysHoverChange");
PersistDropDownName.DataBindings.Add("Checked", splitButton1, "PersistDropDownName");
}
//
// Handle drop down menu items. These items are programmed without
// intellisense support. You need to know that the signature of these
// menu items is void <MethodCall>(object sender, EventArgs e)
//
private void Test1Handler(object sender, EventArgs e)
{
textBox1.Text += "Test 1 was fired" + Environment.NewLine;
}
private void Testing2Handler(object sender, EventArgs e)
{
textBox1.Text += "Testing Testing was fired" + Environment.NewLine;
}
private void Testing3Handle(object sender, EventArgs e)
{
textBox1.Text += "Testing testing testing was fired" + Environment.NewLine;
}
//
// Handle other button events
//
private void splitButton1_Click(object sender, EventArgs e)
{
textBox1.Text += "SplitButton1 was clicked" + Environment.NewLine;
}
private void splitButton1_ButtonClick(object sender, EventArgs e)
{
textBox1.Text += "SplitButton1 ButtonClick was fired" + Environment.NewLine;
}
private void splitButton1_MouseDown(object sender, MouseEventArgs e)
{
textBox1.Text += "SplitButton1 MouseDown was fired" + Environment.NewLine;
}
private void splitButton1_MouseEnter(object sender, EventArgs e)
{
textBox1.Text = "SplitButton1 MouseEnter was fired" + Environment.NewLine;
}
private void splitButton1_MouseHover(object sender, EventArgs e)
{
textBox1.Text += "SplitButton1 MouseHover was fired" + Environment.NewLine;
}
private void splitButton1_MouseLeave(object sender, EventArgs e)
{
textBox1.Text += "SplitButton1 MouseLeave was fired" + Environment.NewLine;
}
private void splitButton1_MouseUp(object sender, MouseEventArgs e)
{
textBox1.Text += "SplitButton1 MouseUp was fired" + Environment.NewLine;
}
private void AlwaysDropDown_CheckedChanged(object sender, EventArgs e)
{
splitButton1.AlwaysDropDown = AlwaysDropDown.Checked;
}
private void AlwaysHoverChange_CheckedChanged(object sender, EventArgs e)
{
splitButton1.AlwaysHoverChange = AlwaysHoverChange.Checked;
}
private void PersistDropDownName_CheckedChanged(object sender, EventArgs e)
{
splitButton1.PersistDropDownName = PersistDropDownName.Checked;
}
private void chbxRTL_CheckedChanged(object sender, EventArgs e)
{
splitButton1.RightToLeft = chbxRTL.Checked ? System.Windows.Forms.RightToLeft.Yes : System.Windows.Forms.RightToLeft.Inherit;
}
}
}