小编Jan*_*Jan的帖子

RichTextBox中新行之后的空格

当用户按下回车键或插入文本时,RichTextBox会在行之间放置额外的空间,而这正是我想要摆脱的.我四处搜索,我找到的唯一合适的解决方案就是这个:

Setter SetParagraphMargin = new Setter();
SetParagraphMargin.Property = Paragraph.MarginProperty;
SetParagraphMargin.Value = new Thickness(0);

Style style = new Style();
style.TargetType = typeof(Paragraph);
style.Setters.Add(SetParagraphMargin);

rtb.Resources.Add("Style", style);
Run Code Online (Sandbox Code Playgroud)

但这仍然行不通.有没有人对我有任何提示?

c# wpf space line richtextbox

7
推荐指数
1
解决办法
1万
查看次数

在AppDomain.CurrentDomain中获取所有用户创建的类

我想遍历我在项目中添加的所有类

Assembly[] foo = AppDomain.CurrentDomain.GetAssemblies();

foreach(Assembly a in foo)
{                
    foreach(Type t in a.GetTypes())
    {

    }
}
Run Code Online (Sandbox Code Playgroud)

这是我尝试但我想排除.net提供的程序集,例如"mscorlib"

c# reflection .net-assembly

5
推荐指数
1
解决办法
2549
查看次数

标签 统计

c# ×2

.net-assembly ×1

line ×1

reflection ×1

richtextbox ×1

space ×1

wpf ×1