本文整理汇总了C#中System.Windows.Forms.FlowLayoutPanel.Focus方法的典型用法代码示例。如果您正苦于以下问题:C# FlowLayoutPanel.Focus方法的具体用法?C# FlowLayoutPanel.Focus怎么用?C# FlowLayoutPanel.Focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.FlowLayoutPanel
的用法示例。
在下文中一共展示了FlowLayoutPanel.Focus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeCompanyFlowPanel
private void InitializeCompanyFlowPanel(FlowLayoutPanel panel, IEnumerable<ICompanyInfo> companies)
{
foreach (ICompanyInfo company in companies)
{
Button button = new Button();
button.FlatStyle = FlatStyle.Flat;
button.BackColor = Color.GhostWhite;
button.Text = company.NickName;
button.Width = 270;
button.Height = 60;
button.Font = new Font(button.Font.FontFamily, 20);
button.Margin = new Padding(5);
button.Click += new EventHandler((object e, EventArgs e1) =>
{
SelectedCompany = company;
SelectedCompanyButton = button;
});
panel.Controls.Add(button);
panel.MouseEnter += new EventHandler((object e, EventArgs e1) => { panel.Focus(); });
panel.FlowDirection = FlowDirection.LeftToRight;
panel.AutoScroll = true;
}
}
示例2: UpdateControls
private void UpdateControls()
{
// tosses the character information relevant to each character
#region Condition Monitor
ConditionMonitorUserControl uc =
this.tabControl.TabPages[(int)DashBoardPages.CM].Controls[0] as ConditionMonitorUserControl;
uc.MaxPhysical = this.CurrentNPC.PhysicalCM;
uc.MaxStun = this.CurrentNPC.StunCM;
uc.Physical = uc.MaxPhysical;
uc.Stun = uc.MaxStun;
#endregion
#region Skill tab
FlowLayoutPanel panel = new FlowLayoutPanel();
foreach (Skill skill in this.CurrentNPC.Skills)
{
if (skill.KnowledgeSkill)
continue; // improvement for knowledge skills goes here
// insert new skill control
SmallSkillControl ucSkill = new SmallSkillControl(this);
ucSkill.Skill = skill;
ucSkill.DiceClick += DiceClick_Clicked;
// add the skill to the collection of skills to show
panel.Controls.Add(ucSkill);
}
panel.Dock = DockStyle.Fill;
panel.AutoScroll = true;
panel.MouseEnter += (object sender, EventArgs e) => { panel.Focus(); };
this.tabControl.TabPages[(int)DashBoardPages.Skills].Controls.Add(panel);
#endregion
#region Dice Roller
DiceRollerControl dice =
this.tabControl.TabPages[(int)DashBoardPages.Dice].Controls[0] as DiceRollerControl;
//dice.NumberOfEdge = this.CurrentNPC.EDG; // todo figure out number of edge dice
#endregion
}
示例3: UpdateControls
private void UpdateControls()
{
if (CurrentNPC == null) return;
// tosses the character information relevant to each character
#region Condition Monitor
ConditionMonitorUserControl uc =
this.tabControl.TabPages[(int) DashBoardPages.CM].Controls[0] as ConditionMonitorUserControl;
uc.MaxPhysical = this.CurrentNPC.PhysicalCM;
uc.MaxStun = this.CurrentNPC.StunCM;
uc.Physical = CurrentNPC.PhysicalCMFilled;
uc.Stun = CurrentNPC.StunCMFilled;
uc.Modifier = CurrentNPC.DamageInitModifier;
uc.MaxOverflow = CurrentNPC.CMOverflow;
#endregion
#region Skill tab
this.tabControl.TabPages[(int) DashBoardPages.Skills].Controls.Clear();
FlowLayoutPanel panel = new FlowLayoutPanel();
foreach (ISkill skill in this.CurrentNPC.Skills.Where(s => s.Rating > 0))
{
if (skill.KnowledgeSkill)
continue; // improvement for knowledge skills goes here
// insert new skill control
SmallSkillControl ucSkill = new SmallSkillControl(this);
ucSkill.Skill = skill;
ucSkill.DiceClick += DiceClick_Clicked;
// add the skill to the collection of skills to show
panel.Controls.Add(ucSkill);
}
panel.Dock = DockStyle.Fill;
panel.AutoScroll = true;
panel.MouseEnter += (object sender, EventArgs e) => { panel.Focus(); };
this.tabControl.TabPages[(int) DashBoardPages.Skills].Controls.Add(panel);
#endregion
#region Dice Roller
// todo figure out number of edge dice
#endregion
#region Spelltab
this.tabControl.TabPages[(int)DashBoardPages.Spells].Controls.Clear();
FlowLayoutPanel spellPanel = new FlowLayoutPanel();
foreach (Spell spell in this.CurrentNPC.Spells.OrderBy(s=>s.Category))
{
//get a new spellcontroll
var ucSpell = GetSmallSpellControl(spell);
LanguageManager.Instance.Load(GlobalOptions.Instance.Language,ucSpell);
// add the skill to the collection of skills to show
spellPanel.Controls.Add(ucSpell);
}
spellPanel.Dock = DockStyle.Fill;
spellPanel.AutoScroll = true;
spellPanel.MouseEnter += (object sender, EventArgs e) => { panel.Focus(); };
this.tabControl.TabPages[(int)DashBoardPages.Spells].Controls.Add(spellPanel);
#endregion
LanguageManager.Instance.Load(GlobalOptions.Instance.Language,this);
}