[英]How to make multiline text for messages in ListView with Winform C#?
我正在 Visual Studio 2019 中通過 C# 制作客戶端-服務器多方聊天。但是當我添加新消息時,它與舊消息在同一行,而不是在新行中。 我該如何解決?
我曾嘗試使用 environment.newline 但並不像預期的那樣
太感謝了
#here is my code for adding new message in client/server file
void addMessage(string s)
{
chatBox.Items.Add(new ListViewItem() { Text = s });
}
解決方案: chatBox.Alignment = ListViewAlignment.Left;
或直接在聊天框屬性的設計器中更改屬性 Alignment
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.