本文整理汇总了C#中System.Windows.Forms.ListControlConvertEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ListControlConvertEventArgs类的具体用法?C# ListControlConvertEventArgs怎么用?C# ListControlConvertEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListControlConvertEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了ListControlConvertEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: cbo_Format
private void cbo_Format(object sender, ListControlConvertEventArgs e)
{
e.Value = Path.GetFileName((string)e.ListItem);
}
开发者ID:factor10,项目名称:Adrenochrome,代码行数:4,代码来源:FTool.cs
示例17: lst_Format
private void lst_Format( object sender, ListControlConvertEventArgs e )
{
e.Value = Path.GetFileName( e.ListItem as string );
}
开发者ID:danbystrom,项目名称:VisionQuest,代码行数:4,代码来源:FStandbylistor.cs
示例18: GetItemText
public string GetItemText (object item)
{
object o = FilterItemOnProperty (item, DisplayMember);
if (o == null)
o = item;
string retval = o.ToString ();
if (FormattingEnabled) {
ListControlConvertEventArgs e = new ListControlConvertEventArgs (o, typeof (string), item);
OnFormat (e);
// The user provided their own value
if (e.Value.ToString () != retval)
return e.Value.ToString ();
if (o is IFormattable)
return ((IFormattable)o).ToString (string.IsNullOrEmpty (FormatString) ? null : FormatString, FormatInfo);
}
return retval;
}
开发者ID:nlhepler,项目名称:mono,代码行数:23,代码来源:ListControl.cs
示例19: OnFormat
protected virtual void OnFormat (ListControlConvertEventArgs e)
{
ListControlConvertEventHandler eh = (ListControlConvertEventHandler)(Events[FormatEvent]);
if (eh != null)
eh (this, e);
}
开发者ID:nlhepler,项目名称:mono,代码行数:6,代码来源:ListControl.cs
示例20: OnFormat
/// <summary>
/// Raises the Format event.
/// </summary>
/// <param name="e">An EventArgs containing the event data.</param>
protected virtual void OnFormat(ListControlConvertEventArgs e)
{
if (Format != null)
Format(this, e);
}
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:9,代码来源:KryptonListBox.cs
注:本文中的System.Windows.Forms.ListControlConvertEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论