Ejemplo n.º 1
0
        /// <summary>
        /// Constructor</summary>
        public DataBoundListView()
        {
            View = View.Details;
            FullRowSelect = true;
            ColumnClick +=  DataBoundListView_ColumnClick;
            LabelEdit = false;
            HideSelection = false;
            DoubleBuffered = true;

            currencyManager_ListChanged = new ListChangedEventHandler(bindingManager_ListChanged);
            currencyManager_PositionChanged = new EventHandler(bindingManager_PositionChanged);
            SelectedIndexChanged += new EventHandler(listView_SelectedIndexChanged);
            ColumnWidthChanged += new ColumnWidthChangedEventHandler(listView_ColumnWidthChanged);
            ColumnWidthChanging += new ColumnWidthChangingEventHandler(listView_ColumnWidthChanging);
            m_textBox = new TextBox();
            // force creation of the window handles on the GUI thread
            // see http://forums.msdn.microsoft.com/en-US/clr/thread/fa033425-0149-4b9a-9c8b-bcd2196d5471/
            IntPtr handle = m_textBox.Handle;
            m_textBox.BorderStyle = BorderStyle.FixedSingle; //BorderStyle.None;
            m_textBox.AutoSize = false;

            m_textBox.LostFocus += textBox_LostFocus;

            // forward textbox events as if they originated with this control
            m_textBox.DragOver += textBox_DragOver;
            m_textBox.DragDrop += textBox_DragDrop;
            m_textBox.MouseHover += textBox_MouseHover;
            m_textBox.MouseLeave += textBox_MouseLeave;

            m_textBox.Visible = false;
            Controls.Add(m_textBox);

            m_comboBox = new ComboBox();
            handle = m_comboBox.Handle;
            m_comboBox.Visible = false;
            m_comboBox.DropDownClosed += new EventHandler(comboBox_DropDownClosed);
            Controls.Add(m_comboBox);
            OwnerDraw = true;

            m_alternatingRowBrush1 = new SolidBrush(m_alternatingRowColor1);
            m_alternatingRowBrush2 = new SolidBrush(m_alternatingRowColor2);

            m_defaultBackColor = BackColor;
            NormalTextColor = Color.Black;
            HighlightTextColor = Color.White;
            ReadOnlyTextColor = Color.DimGray;
            ExternalEditorTextColor = Color.Black;
            HighlightBackColor = SystemColors.Highlight;
            ColumnHeaderTextColor = NormalTextColor;
            ColumnHeaderTextColorDisabled = ReadOnlyTextColor;
            ColumnHeaderCheckMarkColor = Color.DarkSlateGray;
            ColumnHeaderCheckMarkColorDisabled = ReadOnlyTextColor;
            ColumnHeaderSeparatorColor = Color.FromArgb(228, 229, 230);

            m_boldFont = new Font(Font, FontStyle.Bold);
            ShowGroups = false; 

        }
Ejemplo n.º 2
0
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// columnwidthchangedeventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this ColumnWidthChangedEventHandler columnwidthchangedeventhandler, Object sender, ColumnWidthChangedEventArgs e, AsyncCallback callback)
        {
            if (columnwidthchangedeventhandler == null)
            {
                throw new ArgumentNullException("columnwidthchangedeventhandler");
            }

            return(columnwidthchangedeventhandler.BeginInvoke(sender, e, callback, null));
        }
Ejemplo n.º 3
0
        public PerbidList()
        {
            SetStyle(ControlStyles.DoubleBuffer |
                     ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.AllPaintingInWmPaint, true);
            UpdateStyles();

            lvis = new ListViewItem[listMaxSize];

            ColumnWidthChanged  += new ColumnWidthChangedEventHandler(lv_ColumnWidthChanged);
            ColumnWidthChanging += new ColumnWidthChangingEventHandler(lv_ColumnWidthChanging);

            DrawHeader();
            DrawBody();
        }
Ejemplo n.º 4
0
        public QueryListView()
        {
            OwnerDraw         = true;
            DrawItem         += new DrawListViewItemEventHandler(OnDrawItem);
            DrawColumnHeader += new DrawListViewColumnHeaderEventHandler(OnDrawColumnHeader);

            // Columns.Add("");
            Location         = new System.Drawing.Point(46, 111);
            Name             = "queryHistoryList";
            ShowItemToolTips = true;
            Size             = new System.Drawing.Size(533, 500);
            TabIndex         = 0;
            UseCompatibleStateImageBehavior = false;
            FullRowSelect       = true;
            View                = System.Windows.Forms.View.Details;
            Resize             += new System.EventHandler(OnResize);
            ColumnWidthChanged += new ColumnWidthChangedEventHandler(OnColumnWidthChanged);
        }
Ejemplo n.º 5
0
        public StocksList()
        {
            DoubleBuffered = true;

            SetStyle(ControlStyles.DoubleBuffer |
                     ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.AllPaintingInWmPaint, true);
            UpdateStyles();

            lvis = new ListViewItem[listMaxSize];

            DrawColumnHeader    += new DrawListViewColumnHeaderEventHandler(lv_DrawColumnHeader);
            DrawItem            += new DrawListViewItemEventHandler(lv_DrawItem);
            DrawSubItem         += new DrawListViewSubItemEventHandler(lv_DrawSubItem);
            ColumnWidthChanged  += new ColumnWidthChangedEventHandler(lv_ColumnWidthChanged);
            ColumnWidthChanging += new ColumnWidthChangingEventHandler(lv_ColumnWidthChanging);

            MouseDown += new MouseEventHandler(lv_MouseDown);
        }
Ejemplo n.º 6
0
 public ResultsListView(main f)
 {
     mainForm            = f;
     headerFont          = UI.environmentFont;
     OwnerDraw           = true;
     DrawItem           += new DrawListViewItemEventHandler(OnDrawItem);
     DrawColumnHeader   += new DrawListViewColumnHeaderEventHandler(OnDrawColumnHeader);
     Resize             += new EventHandler(OnResize);
     ColumnWidthChanged += new ColumnWidthChangedEventHandler(OnColumnWidthChanged);
     Dock             = System.Windows.Forms.DockStyle.Fill;
     VirtualMode      = true;
     VirtualListSize  = 0;
     BorderStyle      = System.Windows.Forms.BorderStyle.None;
     FullRowSelect    = true;
     HideSelection    = false;
     Location         = new System.Drawing.Point(0, 0);
     Name             = "results";
     ShowItemToolTips = true;
     Size             = new System.Drawing.Size(200, 200);
     UseCompatibleStateImageBehavior = false;
     View                 = System.Windows.Forms.View.Details;
     ColumnClick         += new System.Windows.Forms.ColumnClickEventHandler(this.OnColumnClick);
     RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(OnRetrieveVirtualItem);
 }