當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.ColumnClickEventArgs類代碼示例

本文整理匯總了C#中System.Windows.Forms.ColumnClickEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# ColumnClickEventArgs類的具體用法?C# ColumnClickEventArgs怎麽用?C# ColumnClickEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ColumnClickEventArgs類屬於System.Windows.Forms命名空間,在下文中一共展示了ColumnClickEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: _lstConstantes_ColumnClick

        private void _lstConstantes_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            _lstConstantes.SuspendLayout();

            // Determine whether the column is the same as the last column clicked.
            if (e.Column != _lstConstantesSortColumn)
            {
                // Set the sort column to the new column.
                _lstConstantesSortColumn = e.Column;
                // Set the sort order to ascending by default.
                _lstConstantes.Sorting = SortOrder.Ascending;
            }
            else
            {
                // Determine what the last sort order was and change it.
                if (_lstConstantes.Sorting == SortOrder.Ascending)
                    _lstConstantes.Sorting = SortOrder.Descending;
                else
                    _lstConstantes.Sorting = SortOrder.Ascending;
            }

            // Call the sort method to manually sort.
            _lstConstantes.Sort();
            // Set the ListViewItemSorter property to a new ListViewItemComparer
            this._lstConstantes.ListViewItemSorter = new ListViewItemComparer(e.Column, _lstConstantes.Sorting);

            _lstConstantes.ResumeLayout();
            Cursor.Current = Cursors.Default;
        }
開發者ID:GregXP,項目名稱:XP,代碼行數:30,代碼來源:FrmContantes.cs

示例2: viewAssetList_ColumnClick

        private void viewAssetList_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            if (e.Column == lvmColumnSorter.SortColumn)
            {
                // Reverse the current sort direction for this column.
                if (lvmColumnSorter.Order == SortOrder.Ascending)
                {
                    lvmColumnSorter.Order = SortOrder.Descending;
                }
                else
                {
                    lvmColumnSorter.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // Set the column number that is to be sorted; default to ascending.
                lvmColumnSorter.SortColumn = e.Column;
                lvmColumnSorter.Order = SortOrder.Ascending;
            }

            // Perform the sort with these new sort options.
            this.assetListView.Sort();
            if (Properties.Settings.Default.playSounds)
                Sound.Click.Play();
        }
開發者ID:uwcbc,項目名稱:uwcbc-marimba,代碼行數:26,代碼來源:AssetList.cs

示例3: ListView_ColumnClick

 public static void ListView_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     ListView LV = sender as ListView;
     if (LV == null)
     {
         return;
     }
     ListViewColumnSorter S = LV.ListViewItemSorter as ListViewColumnSorter;
     if (S == null)
     {
         S = new ListViewColumnSorter();
         LV.ListViewItemSorter = S;
         S.Column = -1;
     }
     if (S.Column == e.Column)
     {
         S.Order = ((S.Order == SortOrder.Ascending) ? SortOrder.Descending : SortOrder.Ascending);
     }
     else
     {
         S.Column = e.Column;
         S.Order = SortOrder.Ascending;
     }
     LV.Sort();
 }
開發者ID:Gravenet,項目名稱:POLUtils,代碼行數:25,代碼來源:ListViewColumnSorter.cs

示例4: ListHeader_Click

        private void ListHeader_Click(object sender, ColumnClickEventArgs e)
        {
            bool currSortAsc = _listView.ListViewItemSorter is FieldComparer ? ((FieldComparer)_listView.ListViewItemSorter).Ascending : false;
            int currSortIx = _listView.ListViewItemSorter is FieldComparer ? ((FieldComparer)_listView.ListViewItemSorter).ColumnIndex : -1;

            this._listView.ListViewItemSorter = new FieldComparer(e.Column, currSortIx != e.Column ? true : !currSortAsc);
        }
開發者ID:diadorkin,項目名稱:JiraSVN,代碼行數:7,代碼來源:ListViewSort.cs

示例5: featureList_ColumnClick

 private void featureList_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     bool diffCol = _lastColumnClicked != e.Column;
     _ascending = (diffCol) ? true : !_ascending;
     this.featureList.ListViewItemSorter = new FeatureListViewItemComparer(e.Column, featureList.Columns.Count - 1, _ascending);
     _lastColumnClicked = e.Column;
 }
開發者ID:kpkantaw,項目名稱:msi-spy,代碼行數:7,代碼來源:FeatureForm.cs

示例6: ListColumnClick

        public static void ListColumnClick( ColumnClickEventArgs e )
        {
            ListViewEx ShortLivedListView = OwnerWindow.ShortLivedListView;

            if( ShortLivedListView.Items.Count == 0 )
            {
                return;
            }

            if( e.Column == ColumnToSortBy )
            {
                ColumnSortModeAscending = !ColumnSortModeAscending;
            }
            else
            {
                ColumnToSortBy = e.Column;
                ColumnSortModeAscending = false;
            }

            int[] NewColumnMapping = new int[ ShortLivedColumnMapping.Length ];
            for( int MappingIndex = 0; MappingIndex < NewColumnMapping.Length; MappingIndex++ )
            {
                NewColumnMapping[ MappingIndex ] = ShortLivedColumnMapping[ MappingIndex ];

                if( ShortLivedColumnMapping[ MappingIndex ] < ShortLivedColumnMapping[ e.Column ] )
                {
                    NewColumnMapping[ MappingIndex ]++;
                }
            }
            NewColumnMapping[ e.Column ] = 0;

            // copy items to a temp array because the ListViewItemCollection doesn't have a Sort method
            ListViewItem[] TempItems = new ListViewItem[ ShortLivedListView.Items.Count ];
            uint[] TempValues = new uint[ ShortLivedColumnMapping.Length ];
            for( int MappingIndex = 0; MappingIndex < TempItems.Length; MappingIndex++ )
            {
                FShortLivedCallStackTag Tag = ( FShortLivedCallStackTag )ShortLivedListView.Items[ MappingIndex ].Tag;
                for( int j = 0; j < Tag.ColumnValues.Length; j++ )
                {
                    TempValues[ NewColumnMapping[ j ] ] = Tag.ColumnValues[ ShortLivedColumnMapping[ j ] ];
                }

                uint[] OldValues = Tag.ColumnValues;
                Tag.ColumnValues = TempValues;
                // reuse old array for next value swap
                TempValues = OldValues;

                TempItems[ MappingIndex ] = ShortLivedListView.Items[ MappingIndex ];
            }

            Array.Sort<ListViewItem>( TempItems, CompareShortLivedColumns );

            ShortLivedListView.BeginUpdate();
            ShortLivedListView.Items.Clear();
            ShortLivedListView.Items.AddRange( TempItems );
            ShortLivedListView.SetSortArrow( ColumnToSortBy, ColumnSortModeAscending );
            ShortLivedListView.EndUpdate();

            ShortLivedColumnMapping = NewColumnMapping;
        }
開發者ID:Art1stical,項目名稱:AHRUnrealEngine,代碼行數:60,代碼來源:ShortLivedAllocationView.cs

示例7: listView1_ColumnClick

 private void listView1_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     switch (e.Column)
     {
         case 0:
             listView1.ListViewItemSorter = new ColumnSorter(0);
             listView1.Sort();
             break;
         case 1:
             listView1.ListViewItemSorter = new ColumnSorter(1);
             listView1.Sort();
             break;
         case 2:
             listView1.ListViewItemSorter = new ColumnSorter(2);
             listView1.Sort();
             break;
         case 3:
             listView1.ListViewItemSorter = new ColumnSorter(3);
             listView1.Sort();
             break;
         case 4:
             listView1.ListViewItemSorter = new ColumnSorter(4);
             listView1.Sort();
             break;
     }
 }
開發者ID:AtVirus,項目名稱:DarkAgent,代碼行數:26,代碼來源:LoadedDll.cs

示例8: lstFiles_ColumnClick

        private void lstFiles_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            // check if the selected column is already sorted
            if (e.Column == listViewFilesSorter.SortColumn)
            {
                // Inverse sort order
                if (listViewFilesSorter.Order == SortOrder.Ascending)
                {
                    listViewFilesSorter.Order = SortOrder.Descending;
                }
                else
                {
                    listViewFilesSorter.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // sort ascending on this column
                listViewFilesSorter.SortColumn = e.Column;
                listViewFilesSorter.Order = SortOrder.Ascending;
            }

            // Sort list
            lstFiles.Sort();
        }
開發者ID:haoasqui,項目名稱:ONLYOFFICE-Server,代碼行數:25,代碼來源:Sandbox.cs

示例9: HandleColumnClicked

        public void HandleColumnClicked(System.Windows.Forms.ListView listView, ColumnClickEventArgs e)
        {
            // Determine if clicked column is already the column that is being sorted.
            if (e.Column == this.SortColumn)
            {
                // Reverse the current sort direction for this column.
                if (this.Order == SortOrder.Ascending)
                {
                    this.Order = SortOrder.Descending;
                }
                else
                {
                    this.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // Set the column number that is to be sorted; default to ascending.
                this.SortColumn = e.Column;
                this.Order = SortOrder.Ascending;
            }

            // Perform the sort with these new sort options.
            listView.Sort();            
        }
開發者ID:rlugojr,項目名稱:Alferd-Spritesheet-Unpacker,代碼行數:25,代碼來源:ListViewSorter.cs

示例10: listView1_ColumnClick

 private void listView1_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     columnSorter.SortColumn = e.Column;
     listView1.Sorting = listView1.Sorting == SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending;
     columnSorter.Order = listView1.Sorting;
     listView1.Sort();
 }
開發者ID:tomrus88,項目名稱:WoW-Community-Platform-API,代碼行數:7,代碼來源:MainForm.cs

示例11: lv_controls_ColumnClick

        private void lv_controls_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            // Determine if clicked column is already the column that is being sorted.
            if (e.Column == lvwColumnSorter.SortColumn)
            {
                // Reverse the current sort direction for this column.
                if (lvwColumnSorter.Order == SortOrder.Ascending)
                {
                    lvwColumnSorter.Order = SortOrder.Descending;
                }
                else
                {
                    lvwColumnSorter.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // Set the column number that is to be sorted; default to ascending.
                lvwColumnSorter.SortColumn = e.Column;
                lvwColumnSorter.Order = SortOrder.Ascending;
            }

            // Perform the sort with these new sort options.
            lv_controls.Sort();
        }
開發者ID:javiercrowsoft,項目名稱:CSReports.net,代碼行數:25,代碼來源:fControls.cs

示例12: lvClientes_ColumnClick

        private void lvClientes_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            sorter.SetTipoComparacion(GI.Framework.ListView.ListViewColumnSorter.TipoComparacion.STRING);

            if (e.Column == sorter.SortColumn)
            {
                // Reverse the current sort direction for this column.
                if (sorter.Order == SortOrder.Ascending)
                {
                    sorter.Order = SortOrder.Descending;
                }
                else
                {
                    sorter.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // Set the column number that is to be sorted; default to ascending.
                sorter.SortColumn = e.Column;
                sorter.Order = SortOrder.Ascending;
            }

            // Perform the sort with these new sort options.
            this.lvClientes.Sort();
        }
開發者ID:enzoburga,項目名稱:pimesoft,代碼行數:26,代碼來源:frmListadoClientes.cs

示例13: listView1_ColumnClick

 private void listView1_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     if (e.Column == 0)
     return;
       else if (e.Column == 1)
     ColumnSorter.NumSort = true;
       else
     ColumnSorter.NumSort = false;
       if (e.Column == ColumnSorter.SortColumn)
       {
     // Reverse the current sort direction for this column.
     if (ColumnSorter.Order == SortOrder.Ascending)
       ColumnSorter.Order = SortOrder.Descending;
     else
       ColumnSorter.Order = SortOrder.Ascending;
       }
       else
       {
     // Set the column number that is to be sorted; default to ascending.
     ColumnSorter.SortColumn = e.Column;
     ColumnSorter.Order = SortOrder.Ascending;
       }
       // Perform the sort with these new sort options.
       listView1.Sort();
 }
開發者ID:hdf,項目名稱:Patcher2,代碼行數:25,代碼來源:Form2.cs

示例14: ListItemSorter

        public void ListItemSorter(object sender, ColumnClickEventArgs e)
        {
            ListView list = (ListView)sender;
            int total = list.Items.Count;
            list.BeginUpdate();
            ListViewItem[] items = new ListViewItem[total];
            for (int i = 0; i < total; i++)
            {
                int count = list.Items.Count;
                int minIdx = 0;
                for (int j = 1; j < count; j++)
                {
                    bool test = XFerListColumnCompare(list.Items[j], list.Items[minIdx], e.Column);
                    if ((cols[e.Column] == SortOrder.Ascending && test) ||
                        (cols[e.Column] == SortOrder.Descending && !test))
                        minIdx = j;
                }

                items[i] = list.Items[minIdx];
                list.Items.RemoveAt(minIdx);
            }
            list.Items.AddRange(items);
            list.EndUpdate();
            if (cols[e.Column] == SortOrder.Descending)
                cols[e.Column] = SortOrder.Ascending;
            else if (cols[e.Column] == SortOrder.Ascending)
                cols[e.Column] = SortOrder.Descending;
        }
開發者ID:hnordquist,項目名稱:INCC6,代碼行數:28,代碼來源:TransferList.cs

示例15: listView1_ColumnClick

        private void listView1_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            ListView lv = (sender as ListView);
            if (lv != null)
            {
                Utils.ListViewColumnSorter lvcs = (lv.ListViewItemSorter as Utils.ListViewColumnSorter);
                if (lvcs != null)
                {
                    // Determine if clicked column is already the column that is being sorted.
                    if (e.Column == lvcs.SortColumn)
                    {
                        // Reverse the current sort direction for this column.
                        if (lvcs.Order == SortOrder.Ascending)
                        {
                            lvcs.Order = SortOrder.Descending;
                        }
                        else
                        {
                            lvcs.Order = SortOrder.Ascending;
                        }
                    }
                    else
                    {
                        // Set the column number that is to be sorted; default to ascending.
                        lvcs.SortColumn = e.Column;
                        lvcs.Order = SortOrder.Ascending;
                    }

                    // Perform the sort with these new sort options.
                    lv.Sort();
                }
            }
        }
開發者ID:gahadzikwa,項目名稱:GAPP,代碼行數:33,代碼來源:SelectActionForm.cs


注:本文中的System.Windows.Forms.ColumnClickEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。