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


C# ListViewItem.ListViewSubItem类代码示例

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


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

示例1: table

        public void table(ListView listView1, string otprv, string nazn, string date)
        {
            s_el = parse_el.list("http://rasp.yandex.ru/search/suburban/?fromName=" + otprv + "&fromId=&toName=" + nazn + "&&toId=&when=" + date);
            int number = 1;

            while (1 > 0)
            {
                lv1 = new ListViewItem();
                lv2 = new ListViewItem.ListViewSubItem();
                lv3 = new ListViewItem.ListViewSubItem();
                lv4 = new ListViewItem.ListViewSubItem();
                lv5 = new ListViewItem.ListViewSubItem();
                lv6 = new ListViewItem.ListViewSubItem();

                lv1.Text = Convert.ToString(number);

                //рейсы
                begin_reis[number] = s_el.IndexOf(begin_1, end_reis[number - 1]);
                if (begin_reis[number] < 0) { break; }
                sered_reis[number] = s_el.IndexOf(sered_1, begin_reis[number]);
                end_reis[number] = s_el.IndexOf(end_1, sered_reis[number]);
                lv2.Text = s_el.Substring(begin_reis[number] + begin_1.Length, sered_reis[number] - begin_reis[number] - begin_1.Length) + " - " + s_el.Substring(sered_reis[number] + sered_1.Length, end_reis[number] - sered_reis[number] - sered_1.Length);

                //отправление

                otshet_otpr[number] = s_el.IndexOf(otshet_2, end_otpr[number - 1]);
                begin_otpr[number] = s_el.IndexOf(begin_2, otshet_otpr[number]);
                end_otpr[number] = s_el.IndexOf(end_2, begin_otpr[number]);
                lv3.Text = s_el.Substring(begin_otpr[number] + begin_2.Length, end_otpr[number] - begin_otpr[number] - begin_2.Length);

                time_srvn tsrv = new time_srvn();
                bool time = tsrv.srvn(lv3.Text);
                if (time == true)
                {
                    lv1.BackColor = Color.Gray;
                }

                //прибытие

                otshet_pr[number] = s_el.IndexOf(otshet_3, end_pr[number - 1]);
                begin_pr[number] = s_el.IndexOf(begin_3, otshet_pr[number]);
                end_pr[number] = s_el.IndexOf(end_3, begin_pr[number]);
                lv4.Text = s_el.Substring(begin_pr[number] + begin_3.Length, end_pr[number] - begin_pr[number] - begin_3.Length);

                //остановки

                begin_ost[number] = s_el.IndexOf(begin_4, end_ost[number - 1]);
                end_ost[number] = s_el.IndexOf(end_4, begin_ost[number]);
                lv5.Text = s_el.Substring(begin_ost[number] + begin_4.Length, end_ost[number] - begin_ost[number] - begin_4.Length);

                lv1.SubItems.Add(lv2);
                lv1.SubItems.Add(lv3);
                lv1.SubItems.Add(lv4);
                lv1.SubItems.Add(lv5);
                string rezult = lv2.Text + lv2.Text + lv2.Text + lv2.Text;

                listView1.Items.Add(lv1);
                number += 1;
            }
        }
开发者ID:hardor,项目名称:easytrain,代码行数:60,代码来源:strwork_elec.cs

示例2: PopulateVersionInfo

        private void PopulateVersionInfo( string libraryUrl, string documentName, Proxy.NavigatorRef.ItemKind kind )
        {
            this.Items.Clear( );
            FileIconManager iconManager = new FileIconManager( this.SmallImageList, this.LargeImageList );

            int versionCount = Proxy.ArtifactProxy.GetVersionCount( libraryUrl, documentName );
            int i = 0;
            for( i = 0; i < versionCount; ++i )
            {
                string versionLabel = Proxy.ArtifactProxy.GetVersionLabel( libraryUrl, documentName, i );

                VersionInfo info = new VersionInfo( i, versionLabel );

                ListViewItem item = new ListViewItem( documentName );
                ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem( item, versionLabel );

                item.Tag = info;
                SetIcon( iconManager, item, documentName, kind );
                item.SubItems.Add( subItem );
                this.versionInfo = info;
                this.Items.Add( item );
            }

            this.Items[ i - 1 ].Selected = true;
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:25,代码来源:VersionsListView.cs

示例3: AddFilterProperty

        private void AddFilterProperty(string name, object value, Exception exception)
        {
            //If this property has a value, show that, otherwise show the exception
            ListViewItem item = new ListViewItem();

            item.Text = name;

            ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem();
            if (exception != null)
            {
                subItem.Text = String.Format("ERROR: {0}", exception.Message);
            }
            else if (value != null)
            {
                subItem.Text = value.ToString();
            }
            else
            {
                subItem.Text = "[No value]";
            }

            item.SubItems.Add(subItem);

            filterDetailsListView.Items.Add(item);
        }
开发者ID:anelson,项目名称:panoply,代码行数:25,代码来源:MainForm.cs

示例4: InitForm

        private void InitForm()
        {
            using (new SimpleUtils.SimpleWaitCursor())
            {
                List<GacInterop.AssemblyListEntry> list = GacInterop.GetAssemblyList();

                ListViewItem lvi;
                ListViewItem.ListViewSubItem lvsi;

                foreach (GacInterop.AssemblyListEntry le in list)
                {
                    lvi = new ListViewItem();
                    lvi.Text = le.Name;
                    lvi.Tag = le.FullName;
                    lvi.ToolTipText = le.FullName;
                    lvi.Group = listView1.Groups[ListViewGroupFiltered];

                    lvsi = new ListViewItem.ListViewSubItem();
                    lvsi.Text = le.Version;
                    lvi.SubItems.Add(lvsi);

                    lvsi = new ListViewItem.ListViewSubItem();
                    lvsi.Text = le.PublicKeyToken;
                    lvi.SubItems.Add(lvsi);

                    listView1.Items.Add(lvi);
                }
            }            
        }
开发者ID:adisik,项目名称:simple-assembly-explorer,代码行数:29,代码来源:frmClassEditOpenGAC.cs

示例5: adicionaCat

        //Adiciona as Categorias e orçamentos
        public void adicionaCat()
        {
            listViewCategorias.Items.Clear();
            float gasto = 0;
            DataRow[] registroCat = dados.Tables["Categoria"].Select("CodigoCat > 0");
            DataRow[] registro = dados.Tables["Registros"].Select("Codigo > 0");

            foreach (DataRow categoria in dados.Tables["Categoria"].Rows)
            {
                ListViewItem item = new ListViewItem(categoria["DescricaoCat"].ToString());
                item.UseItemStyleForSubItems = false;
                ListViewItem.ListViewSubItem subItemOrcamento = new ListViewItem.ListViewSubItem(item, categoria["Orcamento"].ToString());

                for (int i = 0; i < registro.Length; i++)
                    if (float.Parse(registro[i]["Valor"].ToString()) < 0)
                        if (registro[i]["Categoria"].ToString() == categoria["CodigoCat"].ToString())
                            gasto += float.Parse(registro[i]["Valor"].ToString());
                gasto *= -1;
               ListViewItem.ListViewSubItem subItemConta = new ListViewItem.ListViewSubItem(item, gasto.ToString());
               if (gasto > float.Parse(categoria["Orcamento"].ToString()))
                   subItemConta.ForeColor = Color.Red;
               else
                   subItemConta.ForeColor = Color.Blue;
               item.SubItems.Add(subItemOrcamento);
               item.SubItems.Add(subItemConta);
               listViewCategorias.Items.Add(item);
               gasto = 0;
            }
        }
开发者ID:PJS2012Grupo1,项目名称:PJS2012Grupo1,代码行数:30,代码来源:Form1.cs

示例6: ListViewHitTestInfo

		public ListViewHitTestInfo(ListViewItem hitItem, ListViewItem.ListViewSubItem hitSubItem,
			ListViewHitTestLocations hitLocation)
		{
			item = hitItem;
			subItem = hitSubItem;
			location = hitLocation;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:ListViewHitTestInfo.cs

示例7: UpdateChangesDialog

        public void UpdateChangesDialog(List<KeyValuePair<GUIMod, GUIModChangeType>> changeset, BackgroundWorker installWorker)
        {
            m_Changeset = changeset;
            m_InstallWorker = installWorker;
            ChangesListView.Items.Clear();

            if (changeset == null)
            {
                return;
            }

            foreach (var change in changeset)
            {
                if (change.Value == GUIModChangeType.None)
                {
                    continue;
                }

                var item = new ListViewItem {Text = String.Format("{0} {1}", change.Key.Name, change.Key.Version)};

                var sub_change_type = new ListViewItem.ListViewSubItem {Text = change.Value.ToString()};

                item.SubItems.Add(sub_change_type);
                ChangesListView.Items.Add(item);
            }
        }
开发者ID:sarbian,项目名称:CKAN,代码行数:26,代码来源:MainChangeset.cs

示例8: InitializeSpecialItems

 private void InitializeSpecialItems()
 {
     NewProfileItem = new ListViewItem(Resources.Label_UI_ProfileListView_NewProfile, NewProfileIconName);
     ListViewItem.ListViewSubItem NewProfileItemSub1 = new ListViewItem.ListViewSubItem(NewProfileItem, Resources.Label_UI_ProfileListView_NewProfile_Description);
     NewProfileItemSub1.ForeColor = SystemColors.ControlDark;
     NewProfileItem.SubItems.Add(NewProfileItemSub1);
 }
开发者ID:tomasdeml,项目名称:roamie,代码行数:7,代码来源:ProfilesListView.cs

示例9: AddItems

 private void AddItems(OperationInfo[] ops, int i = -1)
 {
     lvItems.BeginUpdate();
     foreach(OperationInfo op in ops)
     {
         ListViewItem item = new ListViewItem(op.from);
         item.Tag = op;
         if (op.operation == Operation.Download)
             item.ImageIndex = 1;
         else
             item.ImageIndex = 0;
         ListViewItem.ListViewSubItem subitem = new ListViewItem.ListViewSubItem(item, op.to);
         item.SubItems.Add(subitem);
         subitem = new ListViewItem.ListViewSubItem(item, GetSizeText(op));
         item.SubItems.Add(subitem);
         ProgressListview.ProgressSubItem progress = new ProgressListview.ProgressSubItem(item, GetStatusText(op));
         progress.Owner = item;
         progress.ProgressMaxValue = op.totalSize;
         progress.ProgressValue = op.doneSize;
         progress.ShowProgress = false;
         progress.ForeColor = GetStatusColor(op);
         progress.Tag = op;
         op.Tag = progress;
         item.SubItems.Add(progress);
         if (i >= 0)
             lvItems.Items.Insert(i, item);
         else
             lvItems.Items.Add(item);
         Statistics(op, 1);
     }
     lvItems.EndUpdate();
 }
开发者ID:nwcs,项目名称:BaiduPCS_NET,代码行数:32,代码来源:frmHistory.cs

示例10: InsertNumericParameter

        /// <summary>
        /// Добавить цифровой параметр в список
        /// </summary>
        /// <param name="parameter">Добавляемый параметр</param>
        protected void InsertNumericParameter(VPanelParameter parameter)
        {
            try
            {
                ListViewItem item = new ListViewItem((listView1.Items.Count + 1).ToString());

                //Parameter par = _app.GetParameter(parameter.PNumber);
                Parameter par = _app.GetParameter(parameter.Identifier);

                if (par != null)
                {
                    ListViewItem.ListViewSubItem name = new ListViewItem.ListViewSubItem(item, par.Name);

                    item.Tag = parameter;
                    item.SubItems.Add(name);

                    listView1.Items.Add(item);
                }
                else
                {
                    /*MessageBox.Show(this, "Данный параметр не может быть добавлен на панель", "Сообщение",
                        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                    return;*/
                }

            }
            catch { }
        }
开发者ID:slawer,项目名称:sgt,代码行数:33,代码来源:NumericPanelForm.cs

示例11: InitializeTable

        /// <summary>
        /// Настроить таблицу
        /// </summary>
        protected void InitializeTable()
        {
            for (int i = 0; i < 56; i++)
            {
                if (i > -1 && i < _app.Technology.Parameters.Length)
                {
                    TParameter parameter = _app.Technology.Parameters[i];
                    if (parameter != null)
                    {
                        ListViewItem item = new ListViewItem(parameter.Name);
                        //Parameter par = _app.GetParameter(parameter.PNumber);
                        Parameter par = _app.GetParameter(parameter.Identifier);

                        if (par != null)
                        {
                            ListViewItem.ListViewSubItem sub = new ListViewItem.ListViewSubItem(item, par.Name);
                            item.SubItems.Add(sub);
                        }
                        else
                        {
                            ListViewItem.ListViewSubItem sub = new ListViewItem.ListViewSubItem(item, "не определен");
                            item.SubItems.Add(sub);
                        }

                        item.Tag = parameter;
                        listView1.Items.Add(item);
                    }
                }
            }
        }
开发者ID:slawer,项目名称:sgt,代码行数:33,代码来源:TechParametersForm.cs

示例12: button2_Click

 private void button2_Click(object sender, EventArgs e)
 {
     ListViewItem entry;
     ListViewItem.ListViewSubItem sentry;
     sock.Send(Encoding.ASCII.GetBytes("::dirlist\n\n"), SocketFlags.None);
     string buffer=null;
     string delimiter="\n";
     try
     {
         do
         {
             buffer = Framer.nextFrame(sock, delimiter);
             entry = new ListViewItem();
             entry.Text = buffer;
             sentry = new ListViewItem.ListViewSubItem();
             buffer = Framer.nextFrame(sock, delimiter);
             sentry.Text = buffer;
             entry.SubItems.Add(sentry);
             sentry = new ListViewItem.ListViewSubItem();
             buffer = Framer.nextFrame(sock, delimiter);
             sentry.Text = buffer;
             entry.SubItems.Add(sentry);
             listView1.Items.Add(entry);
             listView1.Refresh();
         }
         while (buffer.EndsWith("\n")==false);
     }
     catch (SocketException excep)
     {
         MessageBox.Show(excep.Message);
     }
 }
开发者ID:idiot000,项目名称:C-Sharp-Practice,代码行数:32,代码来源:Form1.cs

示例13: TreeV_NodeMouseClick

        void TreeV_NodeMouseClick(object sender,
            TreeNodeMouseClickEventArgs e)
        {
            TreeNode newSelected = e.Node;
            listV.Items.Clear();
            DirectoryInfo nodeDirInfo = (DirectoryInfo)newSelected.Tag;
            ListViewItem.ListViewSubItem[] subItems;
            ListViewItem item = null;

            foreach (DirectoryInfo dir in nodeDirInfo.GetDirectories())
            {
                item = new ListViewItem(dir.Name, 0);
                subItems = new ListViewItem.ListViewSubItem[]
                    {new ListViewItem.ListViewSubItem(item, "Directory"),
                     new ListViewItem.ListViewSubItem(item,
                        dir.LastAccessTime.ToShortDateString())};
                item.SubItems.AddRange(subItems);
                listV.Items.Add(item);
            }
            foreach (FileInfo file in nodeDirInfo.GetFiles())
            {
                item = new ListViewItem(file.Name, 1);
                subItems = new ListViewItem.ListViewSubItem[]
                    { new ListViewItem.ListViewSubItem(item, "File"),
                     new ListViewItem.ListViewSubItem(item,
                        file.LastAccessTime.ToShortDateString())};

                item.SubItems.AddRange(subItems);
                listV.Items.Add(item);
            }

            listV.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
        }
开发者ID:qratosone,项目名称:CSharp,代码行数:33,代码来源:Form1.cs

示例14: AddListViewData

        //添加单行数据
        public void AddListViewData(ListView list, Dictionary<string, string> data)
        {
            if (list.InvokeRequired)//不能访问就创建委托
            {
                ListViewDelegate d = new ListViewDelegate(AddListViewData);
                list.Invoke(d, new object[] { list, data });
            }
            else
            {
                list.BeginUpdate();
                ListViewItem list_item = new ListViewItem();
                bool need_init = true;
                foreach (KeyValuePair<string, string> cell in data)
                {
                    ListViewItem.ListViewSubItem list_sub_item = new ListViewItem.ListViewSubItem();
                    if (need_init)
                    {
                        list_item.Text = cell.Value;
                        need_init = false;
                    }
                    else
                    {
                        list_sub_item.Text = cell.Value;
                        list_item.SubItems.Add(list_sub_item);
                    }
                }
                list.Items.Add(list_item);
                list.EnsureVisible(list.Items.Count - 1);
                list.EndUpdate();

            }
        }
开发者ID:zhujunxxxxx,项目名称:TaokeThief,代码行数:33,代码来源:Form1.cs

示例15: buttonAdicionar_Click

        private void buttonAdicionar_Click(object sender, EventArgs e)
        {
            // Validação dos campos Nome, Local e Gênero. Criação do novo item e suitem formando quatro colunas "Nome do filme, Gênero do Filme, Local que foi Assistido e Data", no final são adicionados os subitens ao item e o item ao ListView

            if (textBoxNome.Text == "" || textBoxLocal.Text == "" || comboBoxGen.SelectedIndex == 0)
                MessageBox.Show("Favor preencher todos os campos", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);

            else
            {
                novoItem = new ListViewItem();
                novoItem.Text = textBoxNome.Text;

                ListViewItem.ListViewSubItem SubitemGenero = new ListViewItem.ListViewSubItem();
                SubitemGenero.Text = comboBoxGen.SelectedItem.ToString();

                ListViewItem.ListViewSubItem SubitemLocal = new ListViewItem.ListViewSubItem();
                SubitemLocal.Text = textBoxLocal.Text;

                ListViewItem.ListViewSubItem SubitemData = new ListViewItem.ListViewSubItem();
                SubitemData.Text = dateTimePickerData.Value.Date.ToString("dd/MM/yyyy");

                novoItem.SubItems.Add(SubitemGenero);
                novoItem.SubItems.Add(SubitemLocal);
                novoItem.SubItems.Add(SubitemData);

                listViewFilmes.Items.Add(novoItem);
                ResetForm();
                buttonPesquisar.Visible = true;
            }
        }
开发者ID:wilcosta,项目名称:Atividade_Pratica,代码行数:30,代码来源:Form1.cs


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