/// <summary> /// Initializes a new instance of the PaintHeaderEventArgs class with /// the specified graphics, column, table, column index, header style /// and clipping rectangle /// </summary> /// <param name="g">The Graphics used to paint the Column header</param> /// <param name="column">The Column to be painted</param> /// <param name="table">The Table the Column's ColumnModel belongs to</param> /// <param name="columnIndex">The index of the Column in the Table's ColumnModel</param> /// <param name="headerStyle">The style of the Column's header</param> /// <param name="headerRect">The Rectangle that represents the rectangle /// in which to paint</param> public PaintHeaderEventArgs(Graphics g, Column column, Table table, int columnIndex, ColumnHeaderStyle headerStyle, Rectangle headerRect) : base(g, headerRect) { this.column = column; this.table = table; this.columnIndex = columnIndex; this.column = column; this.headerStyle = headerStyle; this.headerRect = headerRect; this.handled = false; }
/// <summary> /// Initializes a new instance of the PaintHeaderEventArgs class with /// the specified graphics, column, table, column index, header style /// and clipping rectangle /// </summary> /// <param name="g">The Graphics used to paint the Column header</param> /// <param name="column">The Column to be painted</param> /// <param name="table">The Table the Column's ColumnModel belongs to</param> /// <param name="columnIndex">The index of the Column in the Table's ColumnModel</param> /// <param name="headerStyle">The style of the Column's header</param> /// <param name="headerRect">The Rectangle that represents the rectangle /// in which to paint</param> public PaintHeaderEventArgs(Gdk.Drawable g, Column column, HTable table, int columnIndex, ColumnHeaderStyle headerStyle, Gdk.Rectangle headerRect) { this.column = column; this.table = table; this.columnIndex = columnIndex; this.column = column; this.headerStyle = headerStyle; this.headerRect = headerRect; this.handled = false; }
public static void listViewChangeHeaderStyle(ListView varListView, ColumnHeaderStyle varColumnHeaderStyle) { if (varListView.InvokeRequired) { varListView.BeginInvoke(new MethodInvoker(() => listViewChangeHeaderStyle(varListView, varColumnHeaderStyle))); } else { varListView.HeaderStyle = varColumnHeaderStyle; } }
/// <summary> /// Initializes a new instance of the PaintHeaderEventArgs class with /// the specified graphics, column, table, column index, header style /// and clipping rectangle /// </summary> /// <param name="g">The Graphics used to paint the Column header</param> /// <param name="column">The Column to be painted</param> /// <param name="table">The Table the Column's ColumnModel belongs to</param> /// <param name="columnIndex">The index of the Column in the Table's ColumnModel</param> /// <param name="headerStyle">The style of the Column's header</param> /// <param name="headerRect">The Rectangle that represents the rectangle /// in which to paint</param> public I3PaintColumnHeaderEventArgs(Graphics g, I3Column column, I3Table table, int columnIndex, ColumnHeaderStyle headerStyle, Rectangle headerRect) : base(g, headerRect) { this._column = column; this._table = table; this._columnIndex = columnIndex; this._column = column; this._headerStyle = headerStyle; this._headerRect = headerRect; this._handled = false; }
private void printDoc_PrintPage(object sender, PrintPageEventArgs e) { ColumnHeaderStyle c = new ColumnHeaderStyle(); lvTinhThanh.HeaderStyle = ColumnHeaderStyle.Nonclickable; ControlPrint ctrP = new ControlPrint(lvTinhThanh, true); ctrP.PrintWidth = ctrP.CalculateSize().Width; ctrP.PrintHeight = ctrP.CalculateSize().Height; e.Graphics.DrawString("DANH SÁCH NHÓM THUỐC", new Font("Tahoma", 16), Brushes.Black, new PointF(40, 40)); e.Graphics.DrawImageUnscaled(ctrP.GetBitmap(), new Point(100, 100)); e.Graphics.DrawString("STT", new Font("Arial", 11), Brushes.Black, new PointF(100, 100)); e.Graphics.DrawString("Tên", new Font("Arial", 11), Brushes.Black, new PointF(160, 100)); e.Graphics.DrawString("Mô tả", new Font("Arial", 11), Brushes.Black, new PointF(500, 100)); }
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { ColumnHeaderStyle c = new ColumnHeaderStyle(); lvHD.HeaderStyle = ColumnHeaderStyle.Nonclickable; ControlPrint ctrP = new ControlPrint(lvHD, true); ctrP.PrintWidth = ctrP.CalculateSize().Width; ctrP.PrintHeight = ctrP.CalculateSize().Height; e.Graphics.DrawString("NHẮC NHỞ CÔNG NỢ KHÁCH HÀNG", new Font("Tahoma", 16), Brushes.Black, new PointF(40, 40)); e.Graphics.DrawImageUnscaled(ctrP.GetBitmap(), new Point(100, 100)); e.Graphics.DrawString("STT", new Font("Arial", 11), Brushes.Black, new PointF(100, 100)); e.Graphics.DrawString("Mã HD", new Font("Arial", 11), Brushes.Black, new PointF(160, 100)); //e.Graphics.DrawString("Mô tả", new Font("Arial", 11), Brushes.Black, new PointF(500, 100)); }
public ListView() { items = new ListViewItemCollection(this); columns = new ColumnHeaderCollection(this); listItems = new ArrayList(); autoArrange = true; hideSelection = true; labelWrap = true; multiSelect = true; scrollable = true; activation = ItemActivation.Standard; alignStyle = ListViewAlignment.Top; borderStyle = BorderStyle.Fixed3D; headerStyle = ColumnHeaderStyle.Clickable; sorting = SortOrder.None; viewStyle = View.LargeIcon; }
private void printDoc_PrintPage(object sender, PrintPageEventArgs e) { ColumnHeaderStyle c = new ColumnHeaderStyle(); lvLoaiHH.HeaderStyle = ColumnHeaderStyle.Nonclickable; ControlPrint ctrP = new ControlPrint(lvLoaiHH, true); ctrP.PrintWidth = ctrP.CalculateSize().Width; ctrP.PrintHeight = ctrP.CalculateSize().Height; e.Graphics.DrawString("DANH SÁCH LOẠI SẢN PHẨM", new Font("Tahoma", 16), Brushes.Black, new PointF(40, 40)); e.Graphics.DrawImageUnscaled(ctrP.GetBitmap(), new Point(100, 100)); e.Graphics.DrawString("STT", new Font("Arial", 11), Brushes.Black, new PointF(100, 100)); e.Graphics.DrawString("Tên", new Font("Arial", 11), Brushes.Black, new PointF(160, 100)); e.Graphics.DrawString("Mô tả", new Font("Arial", 11), Brushes.Black, new PointF(500, 100)); }
/// <summary> /// /// </summary> /// <param name="headerStyle"></param> internal void SetHeaderStyle(ColumnHeaderStyle headerStyle) { this.headerStyle = headerStyle; }
/*/// <summary> /// Specifies whether pressing the Tab key while editing moves the /// editor to the next available cell /// </summary> private bool tabMovesEditor;*/ #endregion #endregion #region Constructor /// <summary> /// Initializes a new instance of the Table class with default settings /// </summary> public Table() { // starting setup this.init = true; // This call is required by the Windows.Forms Form Designer. components = new System.ComponentModel.Container(); // this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.Selectable, true); this.TabStop = true; this.Size = new Size(150, 150); this.BackColor = Color.White; // this.columnModel = null; this.tableModel = null; // header this.headerStyle = ColumnHeaderStyle.Clickable; this.headerFont = this.Font; this.headerRenderer = new XPHeaderRenderer(); //this.headerRenderer = new GradientHeaderRenderer(); //this.headerRenderer = new FlatHeaderRenderer(); this.headerRenderer.Font = this.headerFont; this.headerContextMenu = new HeaderContextMenu(); this.columnResizing = true; this.resizingColumnIndex = -1; this.resizingColumnWidth = -1; this.hotColumn = -1; this.pressedColumn = -1; this.lastSortedColumn = -1; this.sortedColumnBackColor = Color.WhiteSmoke; // borders this.borderStyle = BorderStyle.Fixed3D; // scrolling this.scrollable = true; this.hScrollBar = new HScrollBar(); this.hScrollBar.Visible = false; this.hScrollBar.Location = new Point(this.BorderWidth, this.Height - this.BorderWidth - SystemInformation.HorizontalScrollBarHeight); this.hScrollBar.Width = this.Width - (this.BorderWidth * 2) - SystemInformation.VerticalScrollBarWidth; this.hScrollBar.Scroll += new ScrollEventHandler(this.OnHorizontalScroll); this.Controls.Add(this.hScrollBar); this.vScrollBar = new VScrollBar(); this.vScrollBar.Visible = false; this.vScrollBar.Location = new Point(this.Width - this.BorderWidth - SystemInformation.VerticalScrollBarWidth, this.BorderWidth); this.vScrollBar.Height = this.Height - (this.BorderWidth * 2) - SystemInformation.HorizontalScrollBarHeight; this.vScrollBar.Scroll += new ScrollEventHandler(this.OnVerticalScroll); this.Controls.Add(this.vScrollBar); // this.gridLines = GridLines.None;; this.gridColor = SystemColors.Control; this.gridLineStyle = GridLineStyle.Solid; this.allowSelection = true; this.multiSelect = false; this.fullRowSelect = false; this.hideSelection = false; this.selectionBackColor = SystemColors.Highlight; this.selectionForeColor = SystemColors.HighlightText; this.unfocusedSelectionBackColor = SystemColors.Control; this.unfocusedSelectionForeColor = SystemColors.ControlText; this.selectionStyle = SelectionStyle.ListView; this.alternatingRowColor = Color.Transparent; // current table state this.tableState = TableState.Normal; this.lastMouseCell = new CellPos(-1, -1); this.lastMouseDownCell = new CellPos(-1, -1); this.focusedCell = new CellPos(-1, -1); this.hoverTime = 1000; this.trackMouseEvent = null; this.ResetMouseEventArgs(); this.toolTip = new ToolTip(this.components); this.toolTip.Active = false; this.toolTip.InitialDelay = 1000; this.noItemsText = "There are no items in this view"; this.editingCell = new CellPos(-1, -1); this.curentCellEditor = null; this.editStartAction = EditStartAction.DoubleClick; this.customEditKey = Keys.F5; //this.tabMovesEditor = true; // finished setting up this.beginUpdateCount = 0; this.init = false; this.preview = false; }
public OPMListView(ColumnHeaderStyle headerStyle) : this() { base.HeaderStyle = headerStyle; }
public void HideHeaders(ColumnHeaderStyle style) { _listView.HeaderStyle = style; }
protected static void ChangeColumnStyle(ColumnHeaderStyle style) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (View.InvokeRequired) { lvChangeHeader d = new lvChangeHeader(ChangeColumnStyle); View.Invoke(d, new object[] { style }); } else { View.HeaderStyle = style; } }