Foxtable(狐表)用户栏目专家坐堂 → RichTextBox的问题


  共有2008人关注过本帖树形打印复制链接

主题:RichTextBox的问题

帅哥哟,离线,有人找我吗?
douglas738888
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1174 积分:8782 威望:0 精华:0 注册:2012/4/18 16:28:00
RichTextBox的问题  发帖心情 Post By:2018/7/19 15:12:00 [只看该作者]

请教老师,参照论坛中的关于使用RichTextBox控件设置行距的代码,生成后,Panel的边框是Fixed3D的,

我在窗口afterload,设置了  rtxt.BorderStyle = BorderStyle.FixedSingle 无效   但参数设置为None就有效

问题,想实现Panel的边框为单线,边框颜色设置为Silver,应该怎样写代码

 

 


全局里面的代码好像是用C#改的,对这个不太懂,不知道怎样修改

Public Class UtilsSetLineSpace
Public Const WM_USER As Integer = &H400
Public Const EM_GETPARAFORMAT As Integer = WM_USER + 61
Public Const EM_SETPARAFORMAT As Integer = WM_USER + 71
Public Const MAX_TAB_STOPS As Long = 32
Public Const PFM_LINESPACING As UInteger = &H100
<StructLayout(LayoutKind.Sequential)> _
Private Structure PARAFORMAT2
Public cbSize As Integer
Public dwMask As UInteger
Public wNumbering As Short
Public wReserved As Short
Public dxStartIndent As Integer
Public dxRightIndent As Integer
Public dxOffset As Integer
Public wAlignment As Short
Public cTabCount As Short
<MarshalAs(UnmanagedType.ByValArray, SizeConst := 32)> _
Public rgxTabs As Integer()
Public dySpaceBefore As Integer
Public dySpaceAfter As Integer
Public dyLineSpacing As Integer
Public sStyle As Short
Public bLineSpacingRule As Byte
Public bOutlineLevel As Byte
Public wShadingWeight As Short
Public wShadingStyle As Short
Public wNumberingStart As Short
Public wNumberingStyle As Short
Public wNumberingTab As Short
Public wBorderSpace As Short
Public wBorderWidth As Short
Public wBorders As Short
End Structure

<DllImport("user32", CharSet := CharSet.Auto)> _
Private Shared Function SendMessage(hWnd As HandleRef, msg As Integer, wParam As Integer, ByRef lParam As PARAFORMAT2) As IntPtr
End Function

''' <summary>
''' 设置行距
''' </summary>
''' <param name="ctl">控件</param>
''' <param name="dyLineSpacing">间距</param>
Public Shared Sub SetLineSpace(ctl As Windows.Forms.Control, dyLineSpacing As Integer)
Dim fmt As New PARAFORMAT2()
fmt.cbSize = Marshal.SizeOf(fmt)
fmt.bLineSpacingRule = 4
' bLineSpacingRule;
fmt.dyLineSpacing = dyLineSpacing
fmt.dwMask = PFM_LINESPACING
Try
    SendMessage(New HandleRef(ctl, ctl.Handle), EM_SETPARAFORMAT, 0, fmt)
   
    Catch
End Try
End Sub

End Class

Public Sub mytxt_TextChanged(sender As Object, e As EventArgs)
Functions.Execute("mytxt_TextChanged", sender, e)
End Sub


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/7/19 15:35:00 [只看该作者]


 回到顶部