本文整理汇总了C#中System.Windows.Forms.RowStyle类的典型用法代码示例。如果您正苦于以下问题:C# RowStyle类的具体用法?C# RowStyle怎么用?C# RowStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RowStyle类属于System.Windows.Forms命名空间,在下文中一共展示了RowStyle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CtorTest3
public void CtorTest3 ()
{
RowStyle rs = new RowStyle (SizeType.Absolute, 5.0f);
Assert.AreEqual (5.0, rs.Height, "1");
Assert.AreEqual (SizeType.Absolute, rs.SizeType, "2");
}
示例2: addTableRow
private int addTableRow()
{
int index = tlpProperties.RowCount++;
RowStyle style = new RowStyle(SizeType.AutoSize);
tlpProperties.RowStyles.Add(style);
return index;
}
示例3: SetTableStyle
private void SetTableStyle()
{
// 行スタイル
for (; table.RowCount != table.RowStyles.Count;)
{
if (table.RowCount < table.RowStyles.Count)
{
this.table.RowStyles.RemoveAt(this.table.RowStyles.Count - 1);
}
else
{
var rowStyle = new RowStyle(SizeType.Percent, (float)100.0 / table.RowCount);
this.table.RowStyles.Add(rowStyle);
}
}
// 列スタイル
for (; table.ColumnCount != table.ColumnStyles.Count;)
{
if (table.ColumnCount < table.ColumnStyles.Count)
{
this.table.ColumnStyles.RemoveAt(this.table.ColumnStyles.Count - 1);
}
else
{
var colStyle = new ColumnStyle(SizeType.Percent, (float)100.0 / table.ColumnCount);
this.table.ColumnStyles.Add(colStyle);
}
}
}
示例4: AddControl
/// <summary>
///
/// </summary>
/// <param name="c"></param>
public void AddControl(Control c)
{
this.tableLayoutPanel1.RowCount += 1;
this.tableLayoutPanel1.Controls.Add(c, 0, this.tableLayoutPanel1.RowCount - 1);
RowStyle style = new RowStyle(SizeType.Absolute, c.Height);
this.tableLayoutPanel1.RowStyles.Add(style);
}
示例5: tableMain_SizeChanged
private void tableMain_SizeChanged(object sender, EventArgs e)
{
ColumnStyle columnLeft = new ColumnStyle(SizeType.Absolute, 200);
ColumnStyle columnRight = new ColumnStyle(SizeType.Absolute, 220);
ColumnStyle columnFill = new ColumnStyle(SizeType.Percent, 100);
RowStyle rowTop = new RowStyle(SizeType.Absolute, 145);
RowStyle rowBottom = new RowStyle(SizeType.Absolute, 256);
RowStyle rowFill = new RowStyle(SizeType.Percent, 100);
tableMain.SuspendLayout();
if (tableMain.Width > columnLeft.Width + columnRight.Width)
{
tableMain.ColumnStyles[0] = columnFill;
tableMain.ColumnStyles[1] = columnRight;
}
else
{
tableMain.ColumnStyles[0] = columnLeft;
tableMain.ColumnStyles[1] = columnFill;
}
if (tableMain.Height > rowTop.Height + rowBottom.Height)
{
tableMain.RowStyles[0] = rowFill;
tableMain.RowStyles[1] = rowBottom;
}
else
{
tableMain.RowStyles[0] = rowTop;
tableMain.RowStyles[1] = rowFill;
}
tableMain.ResumeLayout();
}
示例6: InitOnce
public void InitOnce(TableLayoutPanel grid, ViewModel viewModel)
{
_Grid = grid;
_Style = new RowStyle(SizeType.Absolute, 27F);
Dock = DockStyle.Fill;
_Label = new Label();
_Label.TextAlign = ContentAlignment.MiddleRight;
_Label.Dock = DockStyle.Fill;
TbData.GotFocus += new EventHandler(TbData_GotFocus);
BtView.Image = viewModel.GetImage("att-file-preview");
_Body.ShowTips(BtView, "查看文件");
BtOpen.Image = viewModel.GetImage("att-file-append");
_Body.ShowTips(BtOpen, "添加文件");
//BtFill.Image = viewModel.GetImage("att-copy");
//_Body.ShowTips(BtFill, "复制");
BtCopy.Image = viewModel.GetImage("script-fill-16");
_Body.ShowTips(BtCopy, "填充");
InitSpec(TbData);
}
示例7: AddTableRow
private int AddTableRow()
{
int result = docFileTablePanel.RowCount++;
RowStyle style = new RowStyle(SizeType.Absolute, ROWSIZE);
docFileTablePanel.RowStyles.Add(style);
return result;
}
示例8: addAudio
public void addAudio(int id, int pos)
{
if (pos > 15)
{
this.Invoke((MethodInvoker)delegate()
{
this.audioTable.RowCount++;
RowStyle style = new RowStyle(SizeType.AutoSize);
this.audioTable.RowStyles.Add(style);
});
}
Label num, artist, title, dur;
num = new Label();
num.Text=Convert.ToString(pos);
num.Anchor = (AnchorStyles.Left);
title = new Label();
title.Text=this.audio.audio[id].title;
title.Anchor = (AnchorStyles.Left);
artist = new Label();
artist.Text = this.audio.audio[id].artist;
artist.Anchor = (AnchorStyles.Left);
dur = new Label();
string temp = Convert.ToString(this.audio.audio[id].duration % 60);
if ((this.audio.audio[id].duration % 60) < 10)
temp = "0" + temp;
dur.Text=Convert.ToString(this.audio.audio[id].duration/60)+":"+temp;
dur.Anchor = (AnchorStyles.Left);
dur.TextAlign = ContentAlignment.MiddleLeft;
artist.TextAlign = ContentAlignment.MiddleLeft;
title.TextAlign = ContentAlignment.MiddleLeft;
num.TextAlign = ContentAlignment.MiddleLeft;
//dur.AutoSize = true;
//artist.AutoSize = true; //подгоняем
//title.AutoSize = true;
//num.AutoSize = true;
dur.Width = 40;
artist.Width = 150; //обрезаем
title.Width = 190;
num.Width = 30;
dur.Click += new System.EventHandler(this.audio_Click);
artist.Click += new System.EventHandler(this.audio_Click);
title.Click += new System.EventHandler(this.audio_Click);
num.Click += new System.EventHandler(this.audio_Click);
this.Invoke((MethodInvoker)delegate()
{
this.audioTable.Controls.Add(num, 0, pos);
this.audioTable.Controls.Add(title, 1, pos);
this.audioTable.Controls.Add(artist, 2, pos);
this.audioTable.Controls.Add(dur, 3, pos);
});
}
示例9: AddTableRow
private int AddTableRow(TableLayoutPanel tlp)
{
tlp.RowStyles.Clear();
int index = tlp.RowCount++;
RowStyle style = new RowStyle(SizeType.AutoSize);
tlp.RowStyles.Add(style);
return index;
}
示例10: AddLayoutRow
private void AddLayoutRow( int pixels )
{
RowStyle rs = new RowStyle(SizeType.Absolute);
rs.Height = pixels;
tableLayoutPanel.RowCount++;
tableLayoutPanel.RowStyles.Add(rs);
tableLayoutPanel.Controls.Add( new Label() , 0, tableLayoutPanel.RowCount); // need a control or else the tablelayoutpanel won't work correctly
}
示例11: FormCompass
public FormCompass( FormMain parent )
{
InitializeComponent();
MainFontColor = Color.FromArgb( 0x00, 0x00, 0x00 );
SubFontColor = Color.FromArgb( 0x88, 0x88, 0x88 );
ControlHelper.SetDoubleBuffered( BasePanel );
ControlHelper.SetDoubleBuffered( TableEnemyFleet );
ControlHelper.SetDoubleBuffered( TableEnemyMember );
TableEnemyMember.SuspendLayout();
ControlMembers = new TableEnemyMemberControl[6];
for ( int i = 0; i < ControlMembers.Length; i++ ) {
ControlMembers[i] = new TableEnemyMemberControl( this, TableEnemyMember, i );
}
TableEnemyMember.ResumeLayout();
TableEnemyCandidate.SuspendLayout();
ControlCandidates = new TableEnemyCandidateControl[6];
for ( int i = 0; i < ControlCandidates.Length; i++ ) {
ControlCandidates[i] = new TableEnemyCandidateControl( this, TableEnemyCandidate, i );
}
//row/column style init
for ( int y = 0; y < TableEnemyCandidate.RowCount; y++ ) {
var rs = new RowStyle( SizeType.AutoSize );
if ( TableEnemyCandidate.RowStyles.Count <= y )
TableEnemyCandidate.RowStyles.Add( rs );
else
TableEnemyCandidate.RowStyles[y] = rs;
}
for ( int x = 0; x < TableEnemyCandidate.ColumnCount; x++ ) {
var cs = new ColumnStyle( SizeType.AutoSize );
if ( TableEnemyCandidate.ColumnStyles.Count <= x )
TableEnemyCandidate.ColumnStyles.Add( cs );
else
TableEnemyCandidate.ColumnStyles[x] = cs;
}
TableEnemyCandidate.ResumeLayout();
//BasePanel.SetFlowBreak( TextMapArea, true );
BasePanel.SetFlowBreak( TextDestination, true );
//BasePanel.SetFlowBreak( TextEventKind, true );
BasePanel.SetFlowBreak( TextEventDetail, true );
TextDestination.ImageList = ResourceManager.Instance.Equipments;
TextEventKind.ImageList = ResourceManager.Instance.Equipments;
TextEventDetail.ImageList = ResourceManager.Instance.Equipments;
TextFormation.ImageList = ResourceManager.Instance.Icons;
TextAirSuperiority.ImageList = ResourceManager.Instance.Equipments;
TextAirSuperiority.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedFighter;
ConfigurationChanged();
Icon = ResourceManager.ImageToIcon( ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormCompass] );
}
示例12: AddCheckBoxs
/// <summary>
/// Adds checkbox to panel
/// </summary>
/// <param name="panel">Panel</param>
public void AddCheckBoxs(TableLayoutPanel panel)
{
var questions = inferenceModule.Questions;
var checkBoxs = questions.Select(question => new ThreeStateCheckBox(question.Id, question.Content)).ToArray();
foreach (ThreeStateCheckBox checkBox in checkBoxs)
{
RowStyle style = new RowStyle(SizeType.Absolute, 25);
panel.RowStyles.Add(style);
int index = panel.RowCount;
panel.Controls.Add(checkBox, 0, index);
panel.RowCount++;
}
}
示例13: AddToTable
public void AddToTable( TableLayoutPanel table, int row ) {
table.Controls.Add( ShipName, 0, row );
table.Controls.Add( Equipments, 1, row );
#region set RowStyle
RowStyle rs = new RowStyle( SizeType.Absolute, 21 );
if ( table.RowStyles.Count > row )
table.RowStyles[row] = rs;
else
while ( table.RowStyles.Count <= row )
table.RowStyles.Add( rs );
#endregion
}
示例14: InitOnce
public void InitOnce(TableLayoutPanel grid, ViewModel viewModel)
{
_Grid = grid;
_Style = new RowStyle(SizeType.Absolute, 60F);
Dock = DockStyle.Fill;
_Label = new Label();
_Label.TextAlign = ContentAlignment.MiddleRight;
_Label.Dock = DockStyle.Fill;
TbData.GotFocus += new EventHandler(TbData_GotFocus);
InitSpec(TbData);
}
示例15: AddToTable
public void AddToTable( TableLayoutPanel table, int row ) {
table.Controls.Add( Number, 0, row );
table.Controls.Add( State, 1, row );
#region set RowStyle
RowStyle rs = new RowStyle( SizeType.AutoSize, 0 );
if ( table.RowStyles.Count > row )
table.RowStyles[row] = rs;
else
while ( table.RowStyles.Count <= row )
table.RowStyles.Add( rs );
#endregion
}