当前位置: 首页>>代码示例>>C#>>正文


C# ListViewItem.EnsureVisible方法代码示例

本文整理汇总了C#中System.Windows.Forms.ListViewItem.EnsureVisible方法的典型用法代码示例。如果您正苦于以下问题:C# ListViewItem.EnsureVisible方法的具体用法?C# ListViewItem.EnsureVisible怎么用?C# ListViewItem.EnsureVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.ListViewItem的用法示例。


在下文中一共展示了ListViewItem.EnsureVisible方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddToList

        private void AddToList(DebugDataEventArgs args)
        {
            string[] dbgArgs = args.Data.Split(sep);

            ListViewItem item = new ListViewItem(dbgArgs);
            this.listView1.SafeControlInvoke
            (
                listViewCtrl =>
                {
                    if (listViewCtrl.Items.Count > 300)
                    {
                        listViewCtrl.Items.RemoveAt(0);
                    }
                    listViewCtrl.Items.Add(item);
                    item.EnsureVisible();

                    if (lineCount == 300)
                    {
                        listViewCtrl.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
                    }
                    lineCount--;

                    if ( lineCount == 0)
                    {
                        lineCount = 300;
                    }

                }
            );
            item = null;
        }
开发者ID:5dollartools,项目名称:NAM,代码行数:31,代码来源:FrmDebugView.cs

示例2: AddListViewItem

        public void AddListViewItem(bool recieve, MQTTPacketTypes packetType, int? packetId, string topic, string data, DateTime time)
        {
            if (testing) return;
            // type id topic data time
            ListViewItem newItem = new ListViewItem(new[]
            {
                (packetId != null ? ((int) packetId).ToString() : ""),
                GetPacketTypeString(packetType),
                topic,
                data,
                time.ToShortDateString() + " " + time.ToLongTimeString()
            }) {BackColor = recieve ? Color.FromArgb(148, 255, 114, 114) : Color.FromArgb(148, 61, 218, 61)};
            _listViewItems.Add(newItem);

            if (packetType == MQTTPacketTypes.PINGRESP)
                UpdateLastPingTimeLabel(@"Last successful ping at ",time);

            if (autoScrollCheckBox.Checked)
                newItem.EnsureVisible();

            if (_showPings // if it is a ping and we are allowed to show it just let it through
                || (packetType != MQTTPacketTypes.PINGREQ && packetType != MQTTPacketTypes.PINGRESP)) // or if it isn't a ping
            {
                outputListView.Invoke((MethodInvoker) delegate
                {
                    AddListViewItem(newItem);
                });
            }
        }
开发者ID:Rooster212,项目名称:MQTTDistributedCoursework,代码行数:29,代码来源:ClientForm.cs

示例3: SelectItem

        /**************************************************************/
        /*                     Protected
        /**************************************************************/
		/// <summary>
		/// Selects an item.
		/// </summary>
		/// <param name="aListView">List view</param>
		/// <param name="aListViewItem">Item</param>
        private static void SelectItem(Vista_Api.ListView aListView, ListViewItem aListViewItem) {
            if (aListViewItem != null) {
                aListView.SelectedItems.Clear();
                aListViewItem.Selected = true;
                aListViewItem.Focused = true;
                aListViewItem.EnsureVisible();
            }
        }
开发者ID:divyang4481,项目名称:lextudio,代码行数:16,代码来源:ListViewHelpers.cs

示例4: addPatientForm_PatientUpdateEvent

 private void addPatientForm_PatientUpdateEvent(object sender, PersonIdentityEventArgs e)
 {
     var patientAttributesArray = new string[] { e.Id, e.Surname, e.Name, e.Patronymic };
     var patientItem = new ListViewItem(patientAttributesArray);
     PatientList.Items.Add(patientItem);
     patientItem.EnsureVisible();
     patientItem.Selected = true;
     PatientList.Focus();
 }
开发者ID:dr-dead,项目名称:diplomaWork,代码行数:9,代码来源:MainForm.cs

示例5: AddEntry

        public void AddEntry()
        {
            ListViewItem item = new ListViewItem();
            EntryList.Items.Add(item);
            item.EnsureVisible();

            EntryList.LabelEdit = true;
            item.BeginEdit();
        }
开发者ID:gemerson,项目名称:EEdit,代码行数:9,代码来源:ValueEditor.cs

示例6: addMedicForm_MedicAddEvent

 void addMedicForm_MedicAddEvent(object sender, MedicIdentityEventArgs e)
 {
     var medicAttributesArray = new string[] { e.Id, e.Surname, e.Name, e.Patronymic, e.Profession, e.Category, e.Degree, e.Department };
     var medicItem = new ListViewItem(medicAttributesArray);
     medicList.Items.Add(medicItem);
     medicItem.Group = medicList.Groups[e.Profession];
     medicItem.EnsureVisible();
     medicItem.Selected = true;
     medicList.Focus();
 }
开发者ID:dr-dead,项目名称:diplomaWork,代码行数:10,代码来源:MedicListForm.cs

示例7: AddVariable

        private void AddVariable()
        {
            ListViewItem item = new ListViewItem();
            VarList.Items.Add(item);
            item.Selected = true;
            item.EnsureVisible();

            VarList.LabelEdit = true;
            item.BeginEdit();
        }
开发者ID:gemerson,项目名称:EEdit,代码行数:10,代码来源:EnvEditor.cs

示例8: AddIndication

 private void AddIndication(IndicationEventArgs obj)
 {
     var item = new ListViewItem(new[]
                                     {
                                         ((DateTime)obj.IndicationProperties["IndicationTime"]).ToLongTimeString(),
                                         (string)obj.IndicationProperties["QueryText"],
                                         (string)obj.IndicationProperties["Parameters"],
                                         string.Format("{0} ms", obj.IndicationProperties["ExecutionTimeMS"])
                                     });
     listView1.Items.Add(item);
     item.EnsureVisible();
 }
开发者ID:rbramwell,项目名称:OrionSDK,代码行数:12,代码来源:ActivityMonitorTab.cs

示例9: AddFailedData

        private void AddFailedData()
        {
            foreach (KeyValuePair<string, string> kv in this.mFailedItems)
            {
                ListViewItem oItem = new ListViewItem(kv.Key);
                oItem.SubItems.Add(kv.Value);
                oItem.Group = this.lstSummary.Groups["lstGrpFailed"];

                this.lstSummary.Items.Add(oItem);
                oItem.EnsureVisible();
            }
        }
开发者ID:jpann,项目名称:SSRSMigrate,代码行数:12,代码来源:SummaryForm.cs

示例10: Log

        // -- internal funcs

        private void Log(string msg)
        {
            if (InvokeRequired)
            {
                Invoke(new Action<string>(Log), msg);
                return;
            }
            var lvi = new ListViewItem();
            lvi.Text = lvLog.Items.Count.ToString("00000");
            lvi.SubItems.Add(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            lvi.SubItems.Add(msg);
            lvLog.Items.Add(lvi);
            lvi.EnsureVisible();
        }
开发者ID:hhahh2011,项目名称:CH.Spartan,代码行数:16,代码来源:FormMain.cs

示例11: doSelectItem

		/// <summary>
		/// Does the select item.
		/// </summary>
		/// <param name="listViewItem">The list view item.</param>
		private void doSelectItem(
			ListViewItem listViewItem )
		{
			colorsListView.SelectedItems.Clear();

			listViewItem.Selected = true;
			listViewItem.Focused = true;

			listViewItem.EnsureVisible();

			_needEnsureVisibleListViewItem = listViewItem;

			colorsListView.Select();
			colorsListView.Focus();
		}
开发者ID:fushnisoft,项目名称:ZetaColorEditor,代码行数:19,代码来源:WebColorEditorUserControl.cs

示例12: AddLog

        public void AddLog(Logs.Log log)
        {
            logs.Add(log);

            listViewExLogs.Invoke(new MethodInvoker(delegate
            {
                ListViewItem lvi = new ListViewItem();
                lvi.Tag = log;
                lvi.Text = log.datetime.ToShortTimeString();
                lvi.SubItems.Add(log.logType.ToString());
                lvi.SubItems.Add(log.message);

                listViewExLogs.Items.Add(lvi);
                lvi.EnsureVisible();
            }));
        }
开发者ID:ignaciots,项目名称:EvilFOCA,代码行数:16,代码来源:PanelLogs.cs

示例13: Add

 public void Add(string item_no)
 {
     try
     {
         List<string[]> result=new List<string[]>();
         issueHelper.Issue_ListView_Query(item_no, ref result);
         if (result == null || result.Count == 0 || result[0] == null)
         {
             MessageBox.Show(item_no + "没有查到数据,无法添加!");
         }
         ListViewItem item = new ListViewItem( result[0]);
         listView1.Items.Add(item);
         item.EnsureVisible();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
开发者ID:lihongtao8209,项目名称:myComsume_Recpt,代码行数:19,代码来源:list.cs

示例14: ProcessResponse

 /// <summary>
 /// Process the given response.
 /// </summary>
 internal void ProcessResponse(Response value)
 {
     var inpRep = value as SwitchReport;
     if (inpRep != null)
     {
         var item = new ListViewItem(string.Format("Switch {0} turned {1}", inpRep.Address + 1, inpRep.SensorLevel ? "On" : "Off"));
         item.ForeColor = inpRep.SensorLevel ? Color.Red : Color.Green;
         try
         {
             lvInputs.BeginUpdate();
             lvInputs.Items.Add(item);
         }
         finally
         {
             lvInputs.EndUpdate();
             item.EnsureVisible();
         }
     }
 }
开发者ID:chrissharp,项目名称:LoconetToolbox,代码行数:22,代码来源:SwitchLogView.cs

示例15: listener_EventOccurred

 private void listener_EventOccurred(object sender, ManagedWinapi.Accessibility.AccessibleEventArgs e)
 {
     if (nomouse.Checked && e.EventType == AccessibleEventType.EVENT_OBJECT_LOCATIONCHANGE && e.HWnd == IntPtr.Zero && e.ObjectID == (uint)AccessibleObjectID.OBJID_CURSOR) return;
     if (e.HWnd == clear.Handle || e.HWnd == skip.Handle || e.HWnd == list.Handle) return;
     if (skip.Checked)
     {
         skipped++;
         skip.Text = "Skip (" + skipped + ")";
     }
     else
     {
         ListViewItem lvi = new ListViewItem(new string[] { ""+(idx++), e.EventType.ToString(), "0x"+e.HWnd.ToString("x8"),
         "0x"+e.ObjectID.ToString("x8"), "0x"+e.ChildID.ToString("x8"), "0x"+e.Thread.ToString("x8"),
         e.Time.ToString()});
         lvi.Tag = e;
         list.Items.Add(lvi);
         lvi.EnsureVisible();
     }
 }
开发者ID:hoangduit,项目名称:mwinapi,代码行数:19,代码来源:EventForm.cs


注:本文中的System.Windows.Forms.ListViewItem.EnsureVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。