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


C# Forms.ListControlConvertEventArgs類代碼示例

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


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

示例1: OnDrawItem

 protected override void OnDrawItem(DrawItemEventArgs e)
 {
     if (e.Index < 0)
     {
         base.OnDrawItem(e);
     }
     else
     {
         object listItem = this.Items[e.Index];
         ListControlConvertEventArgs args = new ListControlConvertEventArgs(listItem.ToString(), typeof(string), listItem);
         this.OnFormat(args);
         string str = (string) args.Value;
         if (!string.IsNullOrEmpty(str))
         {
             e.DrawBackground();
             TextRenderer.DrawText(e.Graphics, str, e.Font, e.Bounds, e.ForeColor, TextFormatFlags.SingleLine | TextFormatFlags.VerticalCenter);
             e.DrawFocusRectangle();
         }
         else
         {
             int num = e.Bounds.Top + (e.Bounds.Height / 2);
             e.Graphics.DrawLine(SystemPens.ControlText, e.Bounds.Left, num, e.Bounds.Right, num);
         }
     }
 }
開發者ID:shankithegreat,項目名稱:commanderdotnet,代碼行數:25,代碼來源:FilterComboBox.cs

示例2: OnCboActiveMouseButtonsFormat

		private static void OnCboActiveMouseButtonsFormat(object sender, ListControlConvertEventArgs e)
		{
			if (e.DesiredType == typeof (string))
			{
				e.Value = TypeDescriptor.GetConverter(typeof (XMouseButtons)).ConvertToString(e.ListItem);
			}
		}
開發者ID:nhannd,項目名稱:Xian,代碼行數:7,代碼來源:MouseImageViewerToolPropertyComponentControl.cs

示例3: listBox1_Format

        private void listBox1_Format(object sender, ListControlConvertEventArgs e)
        {
            string value1 = ((Article)e.ListItem).ID.ToString();
            string value2 = ((Article)e.ListItem).Title.ToString();
            string value3 = ((Article)e.ListItem).Price.ToString();

            e.Value = "ID: " + value1 + "; TITLE: " + value2 + "; PRICE: " + value3;
        }
開發者ID:kira333,項目名稱:MyProjects,代碼行數:8,代碼來源:MainForm.cs

示例4: OnFormat

 protected override void OnFormat(ListControlConvertEventArgs e)
 {
     if ((e.ListItem is NamedFilter) && (e.DesiredType == typeof(string)))
     {
         e.Value = ((NamedFilter) e.ListItem).Name;
     }
     base.OnFormat(e);
 }
開發者ID:shankithegreat,項目名稱:commanderdotnet,代碼行數:8,代碼來源:FilterComboBox.cs

示例5: ChangesListBoxFormat

 private static void ChangesListBoxFormat(object sender, ListControlConvertEventArgs e)
 {
     CouchChangeResult change = e.ListItem as CouchChangeResult;
     if ((change != null) && (change.Changes.Length >= 1))
     {
         e.Value = String.Format("{0:0000}\t{1}\t{2}", change.Sequence, change.Id, change.Changes[0].ToString());
     }
 }
開發者ID:jaimerosales,項目名稱:DreamSeat,代碼行數:8,代碼來源:ChangesListBox.cs

示例6: FormatarLista

        private void FormatarLista(object sender, ListControlConvertEventArgs e)
        {
            string nomeAtual = ((TblProduto)e.ListItem).Nome;
            string precoAtual = string.Format("{0:C}", ((TblProduto)e.ListItem).Preco);

            string currentDescriptionPadded = nomeAtual.PadRight(40);

            e.Value = currentDescriptionPadded + precoAtual;
        }
開發者ID:deyvidmaciel,項目名稱:e-serveur,代碼行數:9,代碼來源:InterfaceCliente.cs

示例7: addOwnerComboBox_Format

 /// <summary>
 /// This function runs before each visible item in the addOwnerComboBox is formatted. It retrieves the owners full name and displays it in the combobox.
 /// </summary>
 /// <param name="sender">The object that called this function. In this case the ownerComboBox.</param>
 /// <param name="e">The event arguments for the Format event passed to this function.</param>
 private void addOwnerComboBox_Format(object sender, ListControlConvertEventArgs e)
 {
     int index;
     if( int.TryParse(e.Value.ToString(), out index) )
     {
         index = index - 1;
         DataRow ownerRow = dataModule.ownerDataTable.Rows[index];
         e.Value = ownerRow["FirstName"] + " " + ownerRow["LastName"];
     }
 }
開發者ID:Fman72,項目名稱:assignment2,代碼行數:15,代碼來源:VehicleMaintenanceForm.cs

示例8: FormatPageSize

 private void FormatPageSize(object sender, ListControlConvertEventArgs e)
 {
     if (e.ListItem is PageDimensions)
     {
         var pageDimensions = (PageDimensions)e.ListItem;
         e.Value = string.Format(MiscResources.CustomPageSizeFormat, pageDimensions.Width, pageDimensions.Height, pageDimensions.Unit.Description());
     }
     else
     {
         e.Value = ((Enum)e.ListItem).Description();
     }
 }
開發者ID:v0id24,項目名稱:naps2,代碼行數:12,代碼來源:FEditScanSettings.cs

示例9: controlBox_Format

 private void controlBox_Format(object sender, ListControlConvertEventArgs e)
 {
     if (e.ListItem is string)
     {
         e.Value = "(whole window)";
     }
     else
     {
         WindowContent wc = ((SystemWindow)e.ListItem).Content;
         e.Value = wc == null ? "<Unknown Type>" : wc.ShortDescription;
     }
 }
開發者ID:hoangduit,項目名稱:mwinapi,代碼行數:12,代碼來源:MainForm.cs

示例10: EFaceComboBox_Format

 // 顔選択リストボックスの文字列変換
 private void EFaceComboBox_Format(object sender, ListControlConvertEventArgs e)
 {
     //教育の顔選択肢がわかりやすい文字列になるようにする
     switch ((TalkData.Face)e.ListItem)
     {
         case TalkData.Face.Angry:
             e.Value = "怒り顔"; break;
         case TalkData.Face.Cry:
             e.Value = "泣き顔"; break;
         case TalkData.Face.Normal:
             e.Value = "ノーマル"; break;
         case TalkData.Face.Smile:
             e.Value = "笑顔"; break;
     }
 }
開發者ID:oyasuminasai-Lynx,項目名稱:TalkBot,代碼行數:16,代碼來源:Form1.cs

示例11: cbStudent_Format

 private void cbStudent_Format(object sender, ListControlConvertEventArgs e)
 {
     string firstname = ((Student)e.ListItem).FirstName;
     string lastname= ((Student)e.ListItem).LastName;
     e.Value = lastname + ", " + firstname;
 }
開發者ID:julianhendricks,項目名稱:BKTMProjektSportfest,代碼行數:6,代碼來源:ResultsGUI.cs

示例12: _folderSystems_Format

		private void _folderSystems_Format(object sender, ListControlConvertEventArgs e)
		{
			e.Value = _component.FormatFolderSystem(e.ListItem);
		}
開發者ID:nhannd,項目名稱:Xian,代碼行數:4,代碼來源:FolderExplorerConfigurationComponentControl.cs

示例13: lbCommands_Format

        private void lbCommands_Format(object sender, ListControlConvertEventArgs e)
        {
            F3DEXCommand command = e.ListItem as F3DEXCommand;

            e.Value = string.Format("{0}: {1}", string.Format("{0:X2}", (int)(e.ListItem as F3DEXCommand).CommandID), command.CommandID);
        }
開發者ID:mib-f8sm9c,項目名稱:Cereal64,代碼行數:6,代碼來源:F3DEXEditor.cs

示例14: memberListBox_Format

 private void memberListBox_Format(object sender, ListControlConvertEventArgs e)
 {
     if (e.ListItem is MemberItem) {
         MemberItem item = e.ListItem as MemberItem;
         e.Value = item.DisplayName;
     }
 }
開發者ID:yecaokinux,項目名稱:behaviac,代碼行數:7,代碼來源:MetaStoreDock.cs

示例15: SnapshotsListBox_Format

		private void SnapshotsListBox_Format(object sender, ListControlConvertEventArgs e)
		{
			var item = e.ListItem as Snapshot;
			e.Value = string.Format("({0}) {1} - {2} {3}", item.Id, item.Name, item.DateTime.ToLongTimeString(), item.DateTime.ToShortDateString());
		}
開發者ID:RaptDept,項目名稱:slimtune,代碼行數:5,代碼來源:ProfilerWindow.cs


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