本文整理汇总了C#中System.Windows.Forms.ListView类的典型用法代码示例。如果您正苦于以下问题:C# ListView类的具体用法?C# ListView怎么用?C# ListView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListView类属于System.Windows.Forms命名空间,在下文中一共展示了ListView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TagListViewProcessor
public TagListViewProcessor(ListView listview)
{
_TagTable = new Hashtable(1023);
_Tags = new Stack<string>();
_Item_LV = listview;
_Item_LV.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this._Item_LV_ItemCheck);
}
开发者ID:justinlf,项目名称:RFIDManager,代码行数:7,代码来源:TagListViewProcessor.cs
示例2: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.lvwFields = new System.Windows.Forms.ListView();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.SuspendLayout();
//
// lvwFields
//
this.lvwFields.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lvwFields.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1});
this.lvwFields.FullRowSelect = true;
this.lvwFields.HideSelection = false;
this.lvwFields.Location = new System.Drawing.Point(0, 0);
this.lvwFields.Name = "lvwFields";
this.lvwFields.Size = new System.Drawing.Size(320, 200);
this.lvwFields.TabIndex = 0;
this.lvwFields.View = System.Windows.Forms.View.Details;
//
// columnHeader1
//
this.columnHeader1.Text = "Fields";
this.columnHeader1.Width = 400;
//
// ucPick_Fields
//
this.Controls.Add(this.lvwFields);
this.Name = "ucPick_Fields";
this.Size = new System.Drawing.Size(320, 184);
this.ResumeLayout(false);
}
开发者ID:katshann,项目名称:ogen,代码行数:37,代码来源:ucPick_Fields.cs
示例3: ItemFinder
public ItemFinder(ListView lv)
{
itemPos = new HVH_Ken_Modules.ItemPosite(lv);
m_Lv = lv;
lv.MultiSelect = false;
InitializeComponent();
}
开发者ID:kener1985,项目名称:MyGitHubProj,代码行数:7,代码来源:ItemFinder.cs
示例4: ClearlvItem
public static void ClearlvItem(ListView lv)
{
if (lv.Items.Count > 0)
{
lv.Items.Clear();
}
}
开发者ID:vuchannguyen,项目名称:lg-py,代码行数:7,代码来源:SubFuntion.cs
示例5: DownloadDocument
public string DownloadDocument(ListView fileList)
{
var filePath = string.Empty;
ListViewItem item = fileList.SelectedItems[0];
// Strip off 'Root' from the full path
var path = item.SubItems[1].Text;
filePath = Properties.Settings.Default.DefaultPath.ToString() + path;
if (!string.IsNullOrEmpty(filePath))
{
// Get the file from the server
using (var output = new FileStream(filePath, FileMode.Create))
{
Stream downloadStream;
using (var client = new TemplateManagerClient())
{
downloadStream = client.GetFile(path);
}
downloadStream.CopyTo(output);
}
return filePath;
}
return string.Empty;
}
开发者ID:edgecomputing,项目名称:cats,代码行数:29,代码来源:DocumentProcessorService.cs
示例6: autoSizeColumnsFor
private static void autoSizeColumnsFor(ListView view)
{
view.Columns["Name"].Width = -1;
// view.Columns["Location"].Width = -1;
// view.Columns["DamageVsLarge"].Width = -2;
// view.Columns["DamageVsMedium"].Width = -2;
}
开发者ID:bsimser,项目名称:goldbox,代码行数:7,代码来源:FruaItemViewer.cs
示例7: CheckedLVItemDXList
public CheckedLVItemDXList(ListView lv)
{
if(lv == null) throw new ArgumentNullException("lv");
m_lv = lv;
m_lv.ItemChecked += this.OnItemCheckedChanged;
}
开发者ID:amiryal,项目名称:keepass2,代码行数:7,代码来源:CheckedLVItemDXList.cs
示例8: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.listView = new System.Windows.Forms.ListView();
this.SuspendLayout();
//
// listView
//
this.listView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.listView.Dock = System.Windows.Forms.DockStyle.Fill;
this.listView.FullRowSelect = true;
this.listView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.listView.HideSelection = false;
this.listView.Location = new System.Drawing.Point(0, 0);
this.listView.MultiSelect = false;
this.listView.Name = "listView";
this.listView.Size = new System.Drawing.Size(292, 300);
this.listView.TabIndex = 0;
this.listView.TabStop = false;
this.listView.View = System.Windows.Forms.View.Details;
//
// QuickListForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 300);
this.Controls.Add(this.listView);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "QuickListForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.TopMost = true;
this.ResumeLayout(false);
}
开发者ID:satr,项目名称:regexexplorer,代码行数:36,代码来源:QuickListForm.cs
示例9: AddToListview
internal static void AddToListview(ListView list, KontoEntry entry)
{
// Sätt mellanslagstecken ifall en strän i listan kommer att bli tom eller null, så att det finns något att klicka på och så det inte uppstår exception senare.
entry.ForUi = true;
var kontoEntryElements = entry.RowToSaveToUiSwitched; // RowToSaveForThis;
entry.ForUi = false;
// for (var itemIndex = 0; itemIndex < kontoEntryElements.Length; itemIndex++)//hm, denna kan man nog inte ha här o räkna med bra resultat, men o andra sidan så är det bara för att comboboxen ska dyka upp visuellt, så detta e lugnt
// {
// if (string.IsNullOrEmpty(kontoEntryElements[itemIndex])) {
// kontoEntryElements[itemIndex] = " ";//kanska kan göras på annat ställe
// }
// }
// System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(new string[] {
// "Neww"}, -1, System.Drawing.Color.Lime, System.Drawing.Color.Empty, null);
// byt plats på typavkat och kostnad
// var kostnad = kontoEntryElements[2];
// var typAvkostnad = kontoEntryElements[5];
// kontoEntryElements[2] = typAvkostnad;
// kontoEntryElements[5] = typAvkostnad;
list.Items.Add(new ListViewItem(kontoEntryElements, -1, entry.FontFrontColor, Color.Empty, null)).Tag =
entry;
// man slipper lite tecken och castningarna o likhetstecknet, iom att detta är en fkn//Overkill? hehe, anal. Trodde jag...nu fick jag ju nytta av det så det så
}
开发者ID:perragradeen,项目名称:webbankbudgeter,代码行数:29,代码来源:ViewUpdateUI.cs
示例10: Popola
public static void Popola(ref ListView aListView, IList aListOfData)
{
aListView.SuspendLayout();
aListView.BeginUpdate();
aListView.Items.Clear();
if (ListUtils.isNotEmpty(aListOfData))
{
foreach (object item in aListOfData)
{
if (item is IListViewItemable)
{
aListView.Items.Add(((IListViewItemable)item).toListViewItem());
}
else if (item is DateTime)
{
ListViewItem dateItem = new ListViewItem(item.ToString());
dateItem.Tag = item;
aListView.Items.Add(dateItem);
}
else
{
aListView.Items.Add(((IListViewItemable)item).ToString());
}
}
}
aListView.EndUpdate();
aListView.ResumeLayout();
}
开发者ID:mattocchi,项目名称:VS2005Commons,代码行数:31,代码来源:ListViewUtils.cs
示例11: changeHardwareDetails
// This subroutine is a shortcut that changes the detail-list data on-screen if dropdown selectors are changed
// It also plays a part in initialisation
private void changeHardwareDetails(object hardwareInstance, ListView list)
{
// Clear the list
list.Items.Clear();
if (hardwareInstance != null)
{
// Get the properties of the given hardware class
FieldInfo[] classFields = hardwareInstance.GetType().GetFields();
string name, value;
// Loop through each field in the class
foreach (FieldInfo field in classFields)
{
// Extract the field name (format it)
name = fieldToString(field.Name);
// Extract the value
value = Convert.ToString(field.GetValue(hardwareInstance));
// If the value is zero or blank, output N/A
if (value == "0" || value == "") value = "N/A";
// Add the value to the list
list.Items.Add(new ListViewItem(new string[] {
name,
value
}));
}
// Resize columns
list.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
// Make last column fill the remaining width
list.Columns[list.Columns.Count - 1].Width = -2;
}
}
开发者ID:CJxD,项目名称:CoreView,代码行数:33,代码来源:MainWindowPopulation.cs
示例12: ValidateAndSelectProjectFile
public static void ValidateAndSelectProjectFile(string XmlFileName, ListView lstSelectProject, AppWin_Si4460_CP_ProjectData projectData)
{
XmlDocument xmlSerialisedForm = new XmlDocument();
xmlSerialisedForm.Load(XmlFileName);
AppWin_Si4460_CP_ProjectData data = ValidateProject(xmlSerialisedForm, projectData.ChipType, projectData.ChipRevision, projectData.Version);
SelectProject(lstSelectProject, data.ProjectName);
}
开发者ID:x893,项目名称:WDS,代码行数:7,代码来源:ProjectDataSerializer.cs
示例13: ModulesController
public ModulesController(ListView listView)
: base(listView)
{
Columns.Add(new StandardColumn_Int(
IDS.Modules_Column_ID,
(int)ModuleItemTypes.ID));
Columns.Add(new StandardColumn(
IDS.Modules_Column_Name,
(int)ModuleItemTypes.Name));
Columns.Add(new StandardColumn(
IDS.Modules_Column_Path,
(int)ModuleItemTypes.Path));
Columns.Add(new StandardColumn_Int(
IDS.Modules_Column_ModuleMemorySize,
(int)ModuleItemTypes.ModuleMemorySize));
Columns.Add(new StandardColumn(
IDS.Modules_Column_FileDescription,
(int)ModuleItemTypes.FileDescription));
Columns.Add(new StandardColumn(
IDS.Modules_Column_FileVersion,
(int)ModuleItemTypes.FileVersion));
Columns.Add(new StandardColumn(
IDS.Modules_Column_Product,
(int)ModuleItemTypes.Product));
Columns.Add(new StandardColumn(
IDS.Modules_Column_ProductVersion,
(int)ModuleItemTypes.ProductVersion));
}
开发者ID:k4gdw,项目名称:GSharpTools,代码行数:28,代码来源:ModulesController.cs
示例14: AddLanguageToView
private void AddLanguageToView(string addon_resource, string language, ListView list)
{
try
{
if (languages.ContainsKey(language))
{
languages[language] = LoadPO(language, addon_resource);
}
else
{
ColumnHeader[] ch = new ColumnHeader[] { new ColumnHeader() };
LanguageInfo lng = LoadPO(language, addon_resource);
languages.Add(language, lng);
ch[0].Text = string.Format("Translation({0})", lng.RevisionInfo["Language"].Replace(@"\n", ""));
ch[0].Width = list.Columns[2].Width;
list.Columns.AddRange(ch);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
开发者ID:kib,项目名称:translations,代码行数:26,代码来源:frmMain.cs
示例15: frmReceiptsRecordDialog
public frmReceiptsRecordDialog(ListView lvMain, List<ConsumeMachineMaster_cmm_Info> cmmList)
{
InitializeComponent();
this._lvMain = lvMain;
this._cmmList = cmmList;
_lvList = new List<int>();
foreach(ListViewItem lvItem in _lvMain.CheckedItems)
{
//_lvList.Add(lvItem.Index);
//try
//{
// _lvList.Add(Int32.Parse(lvItem.SubItems[2].ToString()));
//}
//catch
//{
//}
try
{
string s = lvItem.SubItems[2].Text;
_lvList.Add(Int32.Parse(lvItem.SubItems[2].Text));
}
catch
{
}
}
}
开发者ID:Klutzdon,项目名称:SIOTS_HHZX,代码行数:33,代码来源:frmReceiptsRecordDialog.cs
示例16: DeleteColumns
// Метод удаления строки из таблицы.
public static void DeleteColumns(int index, ListView criminalTable, ListOfCriminals directoryList, ListOfCriminalGroup listCriminalGroup)
{
directoryList.Data.RemoveAt(index);
for (int i = index; i < directoryList.Data.Count; i++)
directoryList.Data[i].Index += -1;
criminalTable.Items.Clear();
}
开发者ID:SallamanderD,项目名称:Directory,代码行数:8,代码来源:Controller.cs
示例17: PopulateListView
void PopulateListView(ListView lv, List<KeyValuePair<string, Type>> map, Predicate<KeyValuePair<string, Type>> match)
{
lv.Visible = false;
lv.BeginUpdate();
lv.Items.Clear();
string fmt = "{0:D" + (map.Count.ToString().Length) + "}";
int order = 0;
foreach (var kvp in map)
{
order++;
if (!match(kvp)) continue;
string tag = getTag(kvp.Key);
string wrapper = kvp.Value.Name;
string file = System.IO.Path.GetFileName(kvp.Value.Assembly.Location);
string title = GetAttrValue(kvp.Value.Assembly, typeof(System.Reflection.AssemblyTitleAttribute), "Title");
string description = GetAttrValue(kvp.Value.Assembly, typeof(System.Reflection.AssemblyDescriptionAttribute), "Description");
string company = GetAttrValue(kvp.Value.Assembly, typeof(System.Reflection.AssemblyCompanyAttribute), "Company");
string product = GetAttrValue(kvp.Value.Assembly, typeof(System.Reflection.AssemblyProductAttribute), "Product");
ListViewItem lvi = new ListViewItem(new string[] { String.Format(fmt, order), tag, kvp.Key, wrapper, file, title, description, company, product, });
lvi.Tag = kvp;
lv.Items.Add(lvi);
}
if (lv.Items.Count > 0)
lv.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
lv.EndUpdate();
lv.Visible = true;
}
开发者ID:dwalternatio,项目名称:Sims4Tools,代码行数:27,代码来源:ManageWrappersDialog.cs
示例18: FindInProductList
public static bool FindInProductList(ListView list, ProductSearchSettings settings)
{
if (settings.SearchAll)
return FindAllInProductList(list, settings);
else
return FindFirstInProductList(list, settings);
}
开发者ID:kpkantaw,项目名称:msi-spy,代码行数:7,代码来源:Search.cs
示例19: CreateUI
private void CreateUI()
{
form = new Form();
listSearchResults = new ListView();
form.Controls.Add(listSearchResults);
svc = new SearchResultServiceImpl(sc, listSearchResults);
}
开发者ID:gitter-badger,项目名称:reko,代码行数:7,代码来源:SearchResultServiceTests.cs
示例20: LoadAtt_BW_DATES_InListView
public void LoadAtt_BW_DATES_InListView(ListView lv)
{
Attendance a = new Attendance();
DataTable dt = new DataTable();
dt = a.SELECT_BETWEEN_DATES(dtpFrom.Value, dtpTo.Value);
if (dt != null)
{
lv.Items.Clear();
int ctr = 1;
foreach (DataRow r in dt.Rows)
{
ListViewItem li = new ListViewItem();
li.Text = ctr.ToString();
li.SubItems.Add(r["fullname"].ToString());
li.SubItems.Add(r["position_"].ToString());
li.SubItems.Add(Convert.ToDateTime(r["date_"].ToString()).ToString("MMMM dd, yyyy"));
li.SubItems.Add(Convert.ToDateTime(r["attendance"].ToString()).ToString("hh:mm:ss tt"));
li.Tag = r["empid"].ToString();
// li.SubItems.Add(Convert.ToDateTime(r["date_updated"].ToString()).ToLongDateString());
lv.Items.Add(li);
ctr++;
}
}
}
开发者ID:zerojec,项目名称:MMG-PIAPS,代码行数:26,代码来源:attendance_ctrl.cs
注:本文中的System.Windows.Forms.ListView类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论