本文整理汇总了C#中System.Windows.Forms.TableLayoutPanel.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# TableLayoutPanel.GetType方法的具体用法?C# TableLayoutPanel.GetType怎么用?C# TableLayoutPanel.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TableLayoutPanel
的用法示例。
在下文中一共展示了TableLayoutPanel.GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTableLayoutPanel
private static TableLayoutPanel CreateTableLayoutPanel()
{
int row = 10;
int col = 3;
TableLayoutPanel tlpLayout = new TableLayoutPanel();
tlpLayout.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
tlpLayout.Dock = DockStyle.Fill;
tlpLayout.RowCount = row;
tlpLayout.ColumnCount = col;
for (int i = 0; i < row; i++)
{
tlpLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
}
for (int i = 0; i < col; i++)
{
tlpLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
}
//设置tablelayoutpanel控件的DoubleBuffered 属性为true,这样可以减少或消除由于不断重绘所显示图面的某些部分而导致的闪烁
tlpLayout.GetType()
.GetProperty("DoubleBuffered",
System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)
.SetValue(tlpLayout, true, null);
return tlpLayout;
}
示例2: btnSearch_ItemClick
private void btnSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (barEditItem1.EditValue == null || barEditItem2.EditValue == null)
{
XtraMessageBox.Show("请指定明确的楼层与区域.", "错误提示");
return;
}
splashScreenManager1.ShowWaitForm();
if (tableLayoutPanel1 != null)
{
groupControl3.Controls.Remove(tableLayoutPanel1);
tableLayoutPanel1.Dispose();
}
try
{
tableLayoutPanel1 = new TableLayoutPanel();
tableLayoutPanel1.BackColor = Color.White;
tableLayoutPanel1.Dock = DockStyle.Fill;
tableLayoutPanel1.AutoScroll = true;
tableLayoutPanel1.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(tableLayoutPanel1, true, null);
this.groupControl3.Controls.Add(tableLayoutPanel1);
dt = monthCalendar1.SelectionStart;
iPeroid = radioGroup1.SelectedIndex;
iFloorId = Convert.ToDecimal(barEditItem1.EditValue);
iAreaId = Convert.ToDecimal(barEditItem2.EditValue);
List<MACHINE_SCHEDULE> lstMc1 = db.Fetch<MACHINE_SCHEDULE>("where SCHEDULE_TIME = @0 and SCHEEDULE_PERIOD = @1 and FLOOR_ID = @2 and AREA_ID = @3",
new object[] { monthCalendar1.SelectionStart, radioGroup1.SelectedIndex, barEditItem1.EditValue, barEditItem2.EditValue });
List<MACHINE_INFO> lstInfo = db.Fetch<MACHINE_INFO>("where FLOOR_ID = @0 and AREA_ID = @1 order by BED_NO", new object[] { barEditItem1.EditValue, barEditItem2.EditValue });
MACHINE_LAYOUT mL = db.SingleOrDefault<MACHINE_LAYOUT>("where floorid = @0 and areaid = @1", new object[] { barEditItem1.EditValue, barEditItem2.EditValue });
int iRow = 0; // 行数
int iCol = 0; // 列数
int iCount = 0; // 透析机总数
if (lstInfo != null && lstInfo.Count > 0 && mL != null)
{
iRow = Convert.ToInt32(mL.ROOMROWS);
iCol = Convert.ToInt32(Math.Ceiling((decimal)lstInfo.Count / (decimal)mL.ROOMROWS)); // 向上取整
iCount = lstInfo.Count;
tableLayoutPanel1.Controls.Clear();
tableLayoutPanel1.Size = new System.Drawing.Size(0, 0);
tableLayoutPanel1.AutoSize = true;
tableLayoutPanel1.RowStyles.Clear();
tableLayoutPanel1.Controls.Clear();
tableLayoutPanel1.RowCount = iRow;
tableLayoutPanel1.ColumnCount = iCol;
tableLayoutPanel1.ColumnStyles.Clear();
for (int i = 0; i < iRow; i++)
{
RowStyle rs = new RowStyle();
rs.SizeType = SizeType.Percent;
tableLayoutPanel1.RowStyles.Add(rs);
}
for (int i = 0; i < iCol; i++)
{
ColumnStyle cs = new ColumnStyle();
cs.SizeType = SizeType.AutoSize;
tableLayoutPanel1.ColumnStyles.Add(cs);
}
int iCnt = 0;
for (int r = 0; r < iRow; r++)
{
for (int c = 0; c < iCol; c++)
{
if (iCnt < iCount)
{
// 生成控件
UcDialysis uc = new UcDialysis(lstPatientReg, lstPatientBaseInfo, dt, iFloorId, iAreaId, iPeroid, iFrmType);
uc.No = lstInfo[iCnt].BED_NO;
uc.Model = lstInfo[iCnt].MODEL;
uc.M_Type = lstInfo[iCnt].MACHINETYPE;
uc.SN = lstInfo[iCnt].SN;
uc.InfoID = lstInfo[iCnt].ID;
// 获取该设备的图片
MACHINE_TYPE mType = db.SingleOrDefault<MACHINE_TYPE>("where MODEL = @0 AND M_TYPE = @1", new object[] { lstInfo[iCnt].MODEL, lstInfo[iCnt].MACHINETYPE });
if (mType != null && mType.M_PICTURE != null && mType.M_PICTURE.Length > 0)
uc.Pict = mType.M_PICTURE;
// 根据不同功能,控件按钮全能
switch (iFrmType)
{
case 0:
{
uc.StatusOP = false;
uc.CheckIn = false;
uc.Maintence = false;
uc.Idel = false;
break;
}
//.........这里部分代码省略.........
示例3: Display
private void Display(object sender, DataEventArgs e)
{
IEnumerable<StockInfo> stockList = e.Stocks;
if (!DataService.EnableStock)
stockList = stockList.Where(r => r.IsSilver);
try
{
#region format
//简单通知
//string notifyFormat = "{0}:{1}{2}%{6}%";
string tipsFormat =
@"{0} 涨:{9}% 换:{14}% 盈:{11}
现价:{3} 成本:{13} 股:{12}
最高:{4} 最低:{5}
今开:{1} 昨收:{2}
成交量/额:{6}手/{7}万元
买: 卖:
{15}
代码:{16} 板块:{17}
{18}
时间:{8}
当前:{10}";
string fiveDealFormat =
@"{0}:{1} {2}:{3}";
#endregion
#region 桌面控件初始化
TableLayoutPanel tableLayoutPanel1 = new TableLayoutPanel();
tableLayoutPanel1.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(tableLayoutPanel1, true, null);
tableLayoutPanel1.SuspendLayout();
var rowStyle = new RowStyle(SizeType.Absolute, 9);
for (int j = 0; j < 50; j++)
{
tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 10));
}
tableLayoutPanel1.ColumnCount = 1;
tableLayoutPanel1.RowCount = stockList.Count();
tableLayoutPanel1.Height = tableLayoutPanel1.RowCount * 10;
tableLayoutPanel1.Dock = DockStyle.Fill;
List<Control> controls = new List<Control>();
foreach (Control item in tableLayoutPanel1.Controls)
{
controls.Add(item);
}
foreach (var item in controls)
{
item.Dispose();
}
tableLayoutPanel1.Controls.Clear();
#endregion
int rowIndex = 0;
ToolTip tip = new ToolTip();
#region 显示每一只股票
//只显示指定的股票 并且先按Order+BuyCount排序
var stocks = stockList.Where(row => row.ShowInFolatWindow).OrderByDescending(row => row.Order).ThenByDescending(row => row.BuyCount);
foreach (var rtStock in stocks)
{
Label stockLabel = this.GetNewlabel(rtStock.Order >= -1 && rtStock.Order <= 1);
stockLabel.ForeColor = GetWarnColor(rtStock);
#region 股票桌面信息
stockLabel.Tag = rtStock.Code;
string nameInShort = GetUpOrDownArrowCompareToLastDay(rtStock) + " " + rtStock.SpellingInShort.PadLeft(4, ' ');
stockLabel.Text = string.Format(Constants.Setting.DeskDisplayFormat
, nameInShort //简称
, Math.Round(rtStock.PriceNow, rtStock.PriceNow >= 1000 ? 1 : 2).ToString().PadLeft(6, ' ') //当前价格
, (rtStock.SurgedRange.ToString() + "%").PadLeft(7, ' ') //当日涨幅
, (rtStock.CurrentProfit.ToString()).PadLeft(6, ' ') //当前盈亏
, Math.Round(rtStock.SumProfit, 0).ToString().PadLeft(6, ' ') //总盈亏
, (Math.Round(rtStock.SumProfitPercent * 100, 2).ToString() + "%").PadLeft(8, ' ') //总盈亏比例
, Math.Round(rtStock.BuyPrice, 2).ToString().PadLeft(6, ' ') //成本价
, rtStock.BuyCount.ToString().PadLeft(5, ' ') //股数
, (rtStock.TurnOver.ToString() + "%").PadLeft(7, ' ') //换手率
, rtStock.MarketValue.ToString().PadLeft(6, ' ') //当前市值
, Math.Round(rtStock.SumCost, 0).ToString().PadLeft(6, ' ')
);
#endregion
#region 股票提示信息
string fiveDeal = new StringBuilder()
.AppendFormat(fiveDealFormat, rtStock.Buy1Price.ToString().PadLeft(5, ' '), rtStock.Buy1Count.ToString().PadLeft(6, ' '), rtStock.Sell1Price.ToString().PadLeft(5, ' '), rtStock.Sell1Count.ToString().PadLeft(6, ' ')).AppendLine()
.AppendFormat(fiveDealFormat, rtStock.Buy2Price.ToString().PadLeft(5, ' '), rtStock.Buy2Count.ToString().PadLeft(6, ' '), rtStock.Sell2Price.ToString().PadLeft(5, ' '), rtStock.Sell2Count.ToString().PadLeft(6, ' ')).AppendLine()
.AppendFormat(fiveDealFormat, rtStock.Buy3Price.ToString().PadLeft(5, ' '), rtStock.Buy3Count.ToString().PadLeft(6, ' '), rtStock.Sell3Price.ToString().PadLeft(5, ' '), rtStock.Sell3Count.ToString().PadLeft(6, ' ')).AppendLine()
.AppendFormat(fiveDealFormat, rtStock.Buy4Price.ToString().PadLeft(5, ' '), rtStock.Buy4Count.ToString().PadLeft(6, ' '), rtStock.Sell4Price.ToString().PadLeft(5, ' '), rtStock.Sell4Count.ToString().PadLeft(6, ' ')).AppendLine()
.AppendFormat(fiveDealFormat, rtStock.Buy5Price.ToString().PadLeft(5, ' '), rtStock.Buy5Count.ToString().PadLeft(6, ' '), rtStock.Sell5Price.ToString().PadLeft(5, ' '), rtStock.Sell5Count.ToString().PadLeft(6, ' '))
//.........这里部分代码省略.........