C# 增加列表框中的行距
如何增加listbox1中的行距? ; 以及水平缩进每个字符串。以及listbox1中所选项目的颜色为红色。 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ) 这有你要求的三件事 间距:C# 增加列表框中的行距,c#,listbox,C#,Listbox,如何增加listbox1中的行距? ; 以及水平缩进每个字符串。以及listbox1中所选项目的颜色为红色。 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ) 这有你要求的三件事 间距: listBox1
listBox1.ItemSpacing = 10;
水平缩进每个字符串:
listBox1.ItemFormatStyle.Margin = new Padding(5, 10, 2, 2);
listBox1.ItemFormatStyle.Padding = new Padding(7);
以下是如何更改颜色:
请将所有代码以文本形式发布,而不是图像,还请阅读如何创建一个文件。事实上,您已经扔掉了,它使用了库,我不需要库Mark Hollis检查我的屏幕。错误-ItemFormatStyle太小,抱歉…:(你能把它作为文本发布吗?ItemFormatStyle-缺少构建引用你能描述另一种方式吗?这种方式对我来说不合适
public class Account
{
public string Name { get; set; }
public string Login { get; set; }
public string Password { get; set; }
public override string ToString()
{
return $"{Name}";
}
}
listBox1.ItemSpacing = 10;
listBox1.ItemFormatStyle.Margin = new Padding(5, 10, 2, 2);
listBox1.ItemFormatStyle.Padding = new Padding(7);