本文整理汇总了C#中System.Windows.Forms.CheckBox.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# CheckBox.BringToFront方法的具体用法?C# CheckBox.BringToFront怎么用?C# CheckBox.BringToFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.CheckBox
的用法示例。
在下文中一共展示了CheckBox.BringToFront方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDrawColumnHeader
protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
{
base.OnDrawColumnHeader(e);
if (e.ColumnIndex == 0)
{
var headerCheckBox = new CheckBox {Text = "", Visible = true};
SuspendLayout();
e.DrawBackground();
headerCheckBox.BackColor = Color.Transparent;
headerCheckBox.UseVisualStyleBackColor = true;
headerCheckBox.BackgroundImage = Resources.ListViewHeaderCheckboxBackgroud;
headerCheckBox.SetBounds(e.Bounds.X, e.Bounds.Y,
headerCheckBox.GetPreferredSize(new Size(e.Bounds.Width, e.Bounds.Height)).
Width,
headerCheckBox.GetPreferredSize(new Size(e.Bounds.Width, e.Bounds.Height)).
Height);
headerCheckBox.Size =
new Size(headerCheckBox.GetPreferredSize(new Size(e.Bounds.Width - 1, e.Bounds.Height)).Width + 1,
e.Bounds.Height);
headerCheckBox.Location = new Point(4, 0);
Controls.Add(headerCheckBox);
headerCheckBox.Show();
headerCheckBox.BringToFront();
e.DrawText(TextFormatFlags.VerticalCenter | TextFormatFlags.Left);
headerCheckBox.CheckedChanged += OnHeaderCheckboxCheckedChanged;
ResumeLayout(true);
}
else
{
e.DrawDefault = true;
}
}
示例2: CreateFilterButtons
public void CreateFilterButtons(int x, int y, Panel pnl, EventHandler Handler)
{
List<String> Items = new List<string>(Data.ItemTypes.Keys);
Items.Sort();
foreach (String Type in Items)
if (Type != "NONE" && Type != "ITEM_TYPE_NONE")
{
CheckBox Chk = new CheckBox();
pnl.Controls.Add(Chk);
Chk.UseVisualStyleBackColor = true;
Chk.Text = Type;
Chk.Location = new Point(x, y);
Chk.Name = "_chk" + Type;
Chk.AutoSize = true;
Chk.Checked = true;
Chk.BringToFront();
Chk.CheckedChanged += Handler;
y += 14;
}
}
示例3: CreateGUI
//.........这里部分代码省略.........
location = new Point(x, num6);
arg_5BD_0.Location = location;
groupBox2.TabIndex = num2;
num2++;
int x2 = 10;
int num8 = 15;
int arg_5F9_0 = 0;
int num9 = [email protected][i].values[j].offset_options.Length - 1;
for (int k = arg_5F9_0; k <= num9; k++)
{
RadioButton radioButton = new RadioButton();
radioButton.Name = [email protected][i].values[j].offset_options[k].op_name.Replace(" ", "") + "RadioButton";
radioButton.Text = [email protected][i].values[j].offset_options[k].op_name;
radioButton.Tag = [email protected][i].values[j].offset_options[k].op_value;
if (Operators.ConditionalCompareObjectEqual([email protected][i].values[j].offset_options[k].op_value, [email protected][i].values[j].data, false))
{
radioButton.Checked = true;
}
else
{
radioButton.Checked = false;
}
Control arg_71F_0 = radioButton;
location = new Point(x2, num8);
arg_71F_0.Location = location;
Control arg_742_0 = radioButton;
size = new Size(radioButton.Name.Length * 5 + 15, 15);
arg_742_0.Size = size;
radioButton.TabIndex = num2 + k;
radioButton.CheckedChanged += new EventHandler(this.somethingChanged);
groupBox2.Controls.Add(radioButton);
radioButton.BringToFront();
if (k % 2 == 1)
{
x2 = 10;
num8 += 15;
}
else
{
x2 = (int)Math.Round((double)this.MetaTab.Width / 2.0);
}
}
groupBox.Controls.Add(groupBox2);
num6 += groupBox2.Height;
x = 10;
num2 += [email protected][i].values[j].offset_options.Length;
}
else
{
if (type.Equals("bitmask32"))
{
GroupBox groupBox3 = new GroupBox();
groupBox3.Tag = [email protected][i].values[j].offset;
groupBox3.Name = [email protected][i].values[j].name.Replace(" ", "") + "Group";
groupBox3.Text = [email protected][i].values[j].name;
groupBox3.Width = this.MetaTab.Width - 20;
groupBox3.Height = 20 + ([email protected][i].values[j].offset_options.Length / 2 + [email protected][i].values[j].offset_options.Length % 2) * 16;
groupBox3.TabIndex = num2;
Control arg_916_0 = groupBox3;
location = new Point(x, num6);
arg_916_0.Location = location;
示例4: createCheckBoxes
private void createCheckBoxes()
{
int left = 100;
int top = 55;
for (int k = 0; k < 4; k++)
{
for (int j = 1; j <= 4; j++)
{
for (int i = 1; i <= 20; i++)
{
CheckBox ii = new CheckBox();
ii.AutoSize = false;
ii.Size = new System.Drawing.Size(17, 18);
ii.Name = "cbx" + i;
ii.Text = i.ToString();
ii.Location = new Point(left, top);
ii.Tag = ((20 * k) + i) + ":" + j; // Assuming you have your files in an array or similar
ii.CheckedChanged += new System.EventHandler(this.Check_CheckedChanged);
top += 25;
this.Controls.Add(ii);
ii.BringToFront();
}
top = 55;
if (j == 2)
{
left += 50;
}
else
{
left += 20;
}
} left += 90;
}
}
示例5: Display
public void Display(QuestionDescriptor question)
{
if (question != null)
{
this.question = question;
this.textControl.Title = question.Text.Text;
this.textControl.Description = question.Description.Text;
this.textControl.Url = question.Url.Text;
this.textControl.BeginInfo();
this.textControl.InfoFont = new Font("Arial", 12);
RecalculateLayout();
this.optionControls = new Dictionary<InfoControl, int>();
this.optionsPanel.Controls.Clear();
if (question.MaxOptions == 1)
{
this.maxOptionLabel.Text = Resources.VotingDialogMaxOptionSingle;
this.singleOptionControls = new Dictionary<int, RadioButton>();
int index = 0;
int top = Space;
foreach (OptionDescriptor option in question.Options)
{
var optionInfo = AddOptionInfo(index, top, option);
RadioButton optionControl = new RadioButton();
optionControl.Text = string.Empty;
optionControl.Left = Space;
optionControl.Top = top + BoxTop;
optionControl.Height = optionInfo.Height;
optionControl.TextAlign = ContentAlignment.MiddleRight;
optionControl.Width = BoxWidth;
this.optionsPanel.Controls.Add(optionControl);
optionControl.BringToFront();
optionControl.CheckedChanged += new EventHandler(OptionControl_CheckedChanged);
this.singleOptionControls.Add(index, optionControl);
top += optionControl.Height + VerticalSpace;
index++;
}
}
else
{
this.maxOptionLabel.Text = string.Format(Resources.VotingDialogMaxOptionMulti, question.MaxOptions);
this.multiOptionControls = new Dictionary<int, CheckBox>();
int index = 0;
int top = Space;
foreach (OptionDescriptor option in question.Options)
{
if (!option.IsAbstentionSpecial)
{
var optionInfo = AddOptionInfo(index, top, option);
CheckBox optionControl = new CheckBox();
optionControl.Text = string.Empty;
optionControl.Top = top + BoxTop;
optionControl.Width = BoxWidth;
optionControl.Height = optionInfo.Height;
optionControl.TextAlign = ContentAlignment.MiddleRight;
this.optionsPanel.Controls.Add(optionControl);
optionControl.BringToFront();
optionControl.CheckedChanged += new EventHandler(OptionControl_CheckedChanged);
this.multiOptionControls.Add(index, optionControl);
top += optionControl.Height + VerticalSpace;
}
index++;
}
}
}
}
示例6: SelectColumns
public SelectColumns()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
checkBoxes = new ArrayList();
Hashtable underscored = new Hashtable();
int numCounters = Statistics.GetNumberOfCounters();
for(int i = 0; i < numCounters; i++)
{
string text = Statistics.GetCounterName(i);
for(int j = 0; j < text.Length; j++)
{
if(!Char.IsLetter(text, j))
{
continue;
}
char c = Char.ToLower(text[j]);
if(!underscored.ContainsKey(c))
{
underscored.Add(c, null);
text = text.Substring(0, j) + "&" + text.Substring(j);
break;
}
}
int px = (i % 2) == 1 ? Width / 2 : 16, py = 56;
if(i > 1)
{
py = ((CheckBox)checkBoxes[i - 2]).Bottom;
}
CheckBox box = new CheckBox();
box.Parent = this;
box.Visible = true;
box.Location = new Point(px, py);
box.Width = Width / 2 - 10;
box.Text = text;
box.BringToFront();
checkBoxes.Add(box);
}
}
示例7: CreateFlags
public void CreateFlags(GroupBox GrpBox, int x, int y, bool Chked)
{
int beginY = y;
int count = 0;
foreach(KeyValuePair<String, String> kvp in CustomFlags)
{
CheckBox chkBox = new CheckBox();
chkBox.Text = kvp.Key;
chkBox.Tag = kvp.Value;
GrpBox.Controls.Add(chkBox);
chkBox.Location = new System.Drawing.Point(x, y);
chkBox.AutoSize = true;
chkBox.Checked = Chked;
chkBox.BringToFront();
y += 14;
count++;
if (count == 19)
{
x += 100;
y = beginY;
}
}
}
示例8: DrawGui
//.........这里部分代码省略.........
results = results.DistinctBy(ingr => ingr.ID).Where(ingr => ingr.ID == null || !(ingr.ID.Equals(ing[0].ID) || ingr.ID.Equals(ing[1].ID)))
.OrderBy(ingr => !ingr.Name.Equals("<NONE>")).ThenBy(ingr => ingr.Name).ToList();
results = FilterIngredients(results.Where(ingr => ingr.ID != null).Select(ingr => Ingredients[ingr.ID]));
_drpIng[2].DataSource = noIngs.Concat(results).ToList();
if (ing[2].ID != null && results.Any(ingr => ingr.ID != null && ingr.ID.Equals(ing[2].ID))) _drpIng[2].SelectedItem = ing[2].Name;
};
break;
case 2:
_drpIng[i].SelectedIndexChanged += (o, e) =>
{
var ing = _drpIng.Select(drp => drp.SelectedValue as Ingredient).ToArray();
lblIngId[2].Text = ing[2].ID ?? string.Empty;
var row1 = _dgvEffects[2].Rows.Cast<DataGridViewRow>().First();
for (int j = 0; j < 4; j++)
{
var cell = row1.Cells[j] as DataGridViewTextBoxCell;
if (cell != null)
{
if (ing[2].ID != null)
{
var ef = ing[2].Effects[j];
cell.Value = ef.Name;
}
else cell.Value = string.Empty;
}
}
SetEffectColors();
UpdateResult(o, e);
};
break;
}
#endregion
pnlIngredients.Controls.Add(_drpIng[i]);
_drpIng[i].BringToFront();
_dgvEffects[i] = new DataGridView
{
ColumnCount = 4,
Name = "dgvIng" + i.ToString() + "Effects",
Location = new Point(_drpIng[i].Right + 10, _drpIng[i].Top),
Size = new Size(100 + 3*TxtEffectsWidth, 22),
AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill,
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top,
EditMode = DataGridViewEditMode.EditProgrammatically,
AllowUserToAddRows = false,
AllowUserToDeleteRows = false,
AllowUserToResizeColumns = false,
AllowUserToResizeRows = false,
RowHeadersVisible = false,
ColumnHeadersVisible = false
};
switch (i)
{
case 0: _dgvEffects[i].SelectionChanged += (o, e) => _dgvEffects[0].ClearSelection(); break;
case 1: _dgvEffects[i].SelectionChanged += (o, e) => _dgvEffects[1].ClearSelection(); break;
case 2: _dgvEffects[i].SelectionChanged += (o, e) => _dgvEffects[2].ClearSelection(); break;
}
_dgvEffects[i].Rows.Add(new DataGridViewRow());
var row = _dgvEffects[i].Rows.Cast<DataGridViewRow>().First();
for (int j = 0; j < 4; j++)
{
var cell = row.Cells[0] as DataGridViewTextBoxCell;
if (cell != null)
{
cell.Value = string.Empty;