当前位置: 首页>>代码示例>>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;未经允许,请勿转载。