C#WPF RichTextBox 怎么换行? 10
C#WPFRichTextBox怎么换行?\n,\r\n,NewLine都试过不行。每次换行都换成两行。Hello【换行】【继续输入。。。】...
C#WPF RichTextBox 怎么换行?
\n,\r\n,NewLine都试过不行。
每次换行都换成两行。
Hello【换行】
【继续输入。。。】 展开
\n,\r\n,NewLine都试过不行。
每次换行都换成两行。
Hello【换行】
【继续输入。。。】 展开
2个回答
展开全部
您好,是这样的:
Private Declare Function SendMessage1 Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Private Declare Function SendMessage2 Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Integer) As Long
'' ....
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Any) As Long
Any就是指你在调用SendMessage 函数时,lParam 参数既可以传int,也可以传long,short等等其它类型的参数
相当于你把上面的SendMessage1和SendMessage2 等等函数简化为只需要写一个SendMessage 就可以。
Private Declare Function SendMessage1 Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Private Declare Function SendMessage2 Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Integer) As Long
'' ....
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Any) As Long
Any就是指你在调用SendMessage 函数时,lParam 参数既可以传int,也可以传long,short等等其它类型的参数
相当于你把上面的SendMessage1和SendMessage2 等等函数简化为只需要写一个SendMessage 就可以。
展开全部
临时解决 后期根据自己的排版自己再控制其它Element
<Window x:Class="WpfApplication1.Window2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window2" Height="300" Width="300" Loaded="window_loaded">
<Grid>
<RichTextBox Name="richtextbox" />
</Grid>
</Window>
private void window_loaded(object sender, RoutedEventArgs e) {
System.Windows.Documents.Paragraph p = (System.Windows.Documents.Paragraph)this.richtextbox.Document.Blocks.ElementAt(0);
p.Margin = new Thickness(0, 0, 0, 0);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询