本文整理汇总了C#中System.Windows.Forms.ColumnHeader.AutoResize方法的典型用法代码示例。如果您正苦于以下问题:C# ColumnHeader.AutoResize方法的具体用法?C# ColumnHeader.AutoResize怎么用?C# ColumnHeader.AutoResize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ColumnHeader
的用法示例。
在下文中一共展示了ColumnHeader.AutoResize方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResizeColumn
internal static void ResizeColumn(ColumnHeader columnHeader) {
columnHeader.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
int headerSize = columnHeader.Width;
columnHeader.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
int contentSize = columnHeader.Width;
columnHeader.Width = Math.Max(headerSize, contentSize);
}
示例2: CompressionTest
public CompressionTest()
{
InitializeComponent();
ColumnHeader ch = new ColumnHeader();
ch.Name = "Files";
ch.Text = "Files";
ch.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
mFileList.Columns.Add(ch);
String[] algorithms = Enum.GetNames(typeof(CompressionInterop.Algorithm));
foreach (String algorithm in algorithms)
{
AlgorithmCombo.Items.Add(algorithm);
}
AlgorithmCombo.SelectedIndex = 0;
}
示例3: loadList
private void loadList()
{
try
{
listView.Columns.Clear();
listView.Items.Clear();
HashSet<String[]> listentries = this.report.Entries;
int counter = 0;
foreach (String[] listentry in listentries)
{
//first entry is column headers
if (counter == 0)
{
for (int i = 0; i < listentry.Length; i++)
{
ColumnHeader header = new ColumnHeader();
header.Text = listentry[i];
header.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
listView.Columns.Add(header);
}
}
else
{
ListViewItem listitem = new ListViewItem();
listitem.Text = listentry[0];
if (listView.Columns[0].Text.Length < listentry[0].Length) listView.Columns[0].AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
if ((counter == 1) && isDouble(listentry[0])) listView.Columns[0].TextAlign = HorizontalAlignment.Right;
for (int i = 1; i < listentry.Length; i++)
{
if (listView.Columns[i].Text.Length < listentry[i].Length) listView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
listitem.SubItems.Add(listentry[i]);
if ((counter == 1) && isDouble(listentry[i])) listView.Columns[i].TextAlign = HorizontalAlignment.Right;
}
listView.Items.Add(listitem);
}
counter++;
}
}
catch (Exception ex)
{
Tools.ShowError("Unable to load report list\n" + ex.Message);
}
}
示例4: InitialiseColumnHeaders
private void InitialiseColumnHeaders()
{
if (Style == ColumnStyle.OneColumn)
{
ColumnHeader mainColumn = new ColumnHeader();
lstList.Columns.Add(mainColumn);
mainColumn.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
lstList.HeaderStyle = ColumnHeaderStyle.None;
lstList.FullRowSelect = false;
}
else
{
ColumnHeader column1 = new ColumnHeader();
column1.Text = m_headers[1];
ColumnHeader column2 = new ColumnHeader();
column2.Text = m_headers[2];
lstList.Columns.Add(column1);
lstList.Columns.Add(column2);
lstList.HeaderStyle = ColumnHeaderStyle.Nonclickable;
lstList.FullRowSelect = true;
}
}
示例5: InitializeComponent
private void InitializeComponent()
{
this.dccFileList = new FlickerFreeListView();
this.dccFileList.SuspendLayout();
this.SuspendLayout();
Panel dccPanel = new Panel();
dccPanel.BackColor = Color.LightGray;
dccPanel.Size = new Size(this.Width, 45);
dccPanel.Dock = DockStyle.Bottom;
Button dccCancel = new Button();
dccCancel.Name = "dccCancel";
dccCancel.Click += new EventHandler(dccCancel_Click);
dccCancel.Location = new Point(5, 5);
dccCancel.Size = new Size(100, 35);
dccCancel.Text = "Cancel";
dccCancel.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dccCancel.UseVisualStyleBackColor = true;
dccPanel.Controls.Add(dccCancel);
Button dccOpen = new Button();
dccOpen.Name = "dccOpen";
dccOpen.Click += new EventHandler(dccOpen_Click);
dccOpen.Location = new Point(110, 5);
dccOpen.Size = new Size(100, 35);
dccOpen.Text = "Open Folder";
dccOpen.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dccOpen.UseVisualStyleBackColor = true;
dccPanel.Controls.Add(dccOpen);
Button dccRemove = new Button();
dccRemove.Name = "dccRemove";
dccRemove.Click += new EventHandler(dccRemove_Click);
dccRemove.Location = new Point(220, 5);
dccRemove.Size = new Size(100, 35);
dccRemove.Text = "Remove";
dccRemove.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dccRemove.UseVisualStyleBackColor = true;
dccPanel.Controls.Add(dccRemove);
this.dccFileList.Dock = DockStyle.Fill;
this.dccFileList.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.dccFileList.View = View.Details;
this.dccFileList.ShowItemToolTips = true;
this.dccFileList.MultiSelect = false;
this.dccFileList.FullRowSelect = true;
this.dccFileList.HideSelection = false;
this.dccFileList.DoubleClick += new EventHandler(dccFileList_DoubleClick);
ColumnHeader fn = new ColumnHeader();
fn.Text = "File Name";
fn.Width = 200;
fn.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
this.dccFileList.Columns.Add(fn);
ColumnHeader n = new ColumnHeader();
n.Text = "Nick";
n.Width = 80;
this.dccFileList.Columns.Add(n);
ColumnHeader fs = new ColumnHeader();
fs.Text = "File Size";
fs.Width = 150;
this.dccFileList.Columns.Add(fs);
ColumnHeader sp = new ColumnHeader();
sp.Text = "Speed";
sp.Width = 100;
this.dccFileList.Columns.Add(sp);
ColumnHeader el = new ColumnHeader();
el.Text = "Elapsed";
el.Width = 100;
this.dccFileList.Columns.Add(el);
ColumnHeader s = new ColumnHeader();
s.Text = "Status";
s.Width = 100;
s.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
this.dccFileList.Columns.Add(s);
//store the dcc file style (upload/download)
ColumnHeader st = new ColumnHeader();
st.Text = "Style";
st.Width = 0;
st.AutoResize(ColumnHeaderAutoResizeStyle.None);
this.dccFileList.Columns.Add(st);
this.dccFileList.Columns[6].Width = 0;
//store the server id of the connection
ColumnHeader sid = new ColumnHeader();
sid.Text = "ServerID";
sid.Width = 0;
sid.AutoResize(ColumnHeaderAutoResizeStyle.None);
this.dccFileList.Columns.Add(sid);
this.dccFileList.Columns[7].Width = 0;
//store the path/folder for the dcc file
ColumnHeader pa = new ColumnHeader();
//.........这里部分代码省略.........
示例6: IceTabPageDCC
public IceTabPageDCC(WindowType windowType, string sCaption)
: base(windowType, sCaption)
{
this.dccFileList = new FlickerFreeListView();
this.dccFileList.SuspendLayout();
this.SuspendLayout();
Panel dccPanel = new Panel();
dccPanel.BackColor = Color.LightGray;
dccPanel.Size = new Size(this.Width, 55);
dccPanel.Dock = DockStyle.Bottom;
Button dccCancel = new Button();
dccCancel.Name = "dccCancel";
dccCancel.Click += new EventHandler(dccCancel_Click);
dccCancel.Location = new Point(5, 5);
dccCancel.Size = new Size(100, 35);
dccCancel.Text = "Cancel";
dccCancel.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dccCancel.UseVisualStyleBackColor = true;
dccPanel.Controls.Add(dccCancel);
Button dccOpen = new Button();
dccOpen.Name = "dccOpen";
dccOpen.Click += new EventHandler(dccOpen_Click);
dccOpen.Location = new Point(110, 5);
dccOpen.Size = new Size(100, 35);
dccOpen.Text = "Open Folder";
dccOpen.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dccOpen.UseVisualStyleBackColor = true;
dccPanel.Controls.Add(dccOpen);
Button dccRemove = new Button();
dccRemove.Name = "dccRemove";
dccRemove.Click += new EventHandler(dccRemove_Click);
dccRemove.Location = new Point(220, 5);
dccRemove.Size = new Size(100, 35);
dccRemove.Text = "Remove";
dccRemove.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dccRemove.UseVisualStyleBackColor = true;
dccPanel.Controls.Add(dccRemove);
this.dccFileList.Dock = DockStyle.Fill;
this.dccFileList.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.dccFileList.View = View.Details;
this.dccFileList.MultiSelect = false;
this.dccFileList.FullRowSelect = true;
this.dccFileList.HideSelection = false;
this.dccFileList.DoubleClick += new EventHandler(dccFileList_DoubleClick);
ColumnHeader fn = new ColumnHeader();
fn.Text = "File Name";
fn.Width = 250;
fn.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
this.dccFileList.Columns.Add(fn);
ColumnHeader n = new ColumnHeader();
n.Text = "Nick";
n.Width = 100;
this.dccFileList.Columns.Add(n);
ColumnHeader fs = new ColumnHeader();
fs.Text = "File Size";
fs.Width = 200;
this.dccFileList.Columns.Add(fs);
ColumnHeader s = new ColumnHeader();
s.Text = "Status";
s.Width = 150;
s.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
this.dccFileList.Columns.Add(s);
//store the dcc file style (upload/download)
ColumnHeader st = new ColumnHeader();
st.Text = "Style";
st.Width = 0;
st.AutoResize(ColumnHeaderAutoResizeStyle.None);
this.dccFileList.Columns.Add(st);
this.dccFileList.Columns[4].Width = 0;
//store the path/folder for the dcc file
ColumnHeader pa = new ColumnHeader();
pa.Text = "Path";
pa.Width = 0;
pa.AutoResize(ColumnHeaderAutoResizeStyle.None);
this.dccFileList.Columns.Add(pa);
this.dccFileList.Columns[5].Width = 0;
this.Controls.Add(dccFileList);
this.Controls.Add(dccPanel);
this.dccFileList.ResumeLayout(false);
this.ResumeLayout(false);
dccFiles = new List<DccFileStruct>();
}
示例7: AddColunmListView
// them columnheader cho list view
private ColumnHeader AddColunmListView(string text)
{
ColumnHeader headerCol = new ColumnHeader();
headerCol.Text = text;
headerCol.Width = 24;
headerCol.TextAlign = HorizontalAlignment.Center;
headerCol.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
return headerCol;
}
示例8: init
private void init()
{
logic = new Logic();
btnAdd.Enabled = false;
btnStart.Enabled = false;
AdminToolStripMenuItem.Enabled = false;
printToolStripMenuItem.Enabled = false;
printPreviewToolStripMenuItem.Enabled = false;
m_lngPrintingPage = 1;
m_lngPrintingRow = 0;
ColumnHeader column = new ColumnHeader();
column.Width = 150;
column.Text = "Name";
column.AutoResize(ColumnHeaderAutoResizeStyle.None);
lViewParty.Columns.Add(column);
lViewParty.View = View.Details;
lViewParty.GridLines = true;
lViewParty.FullRowSelect = true;
lViewParty.MultiSelect = false;
fileName = "";
//TODO: make init create all directories and files needed to start the graphics program so no crashes occure...
// TODO: Fix so that we can select what screen it should show on
FrmAdmin.Res = "800x600" + "@" + OpenTK.DisplayDevice.GetDisplay(OpenTK.DisplayIndex.Default).RefreshRate; //OpenTK.DisplayDevice.AvailableDisplays[0].RefreshRate; // this buggs out on mono with changing to fullscreen
}