Thnx TipGiver. Actually i wanted to change the border of rtb. For this i hav created my own rtb class
Public Class RichTextBoxEx
inherits RichTextBox
Public Sub DrawBorder(ByVal Border as System.Drawing.Graphics)
Me.BorderStyle = Windows.Forms.BorderStyle.None
Dim rect as Rectangle...
I am designing an Urdu editor. Urdu language is written from right to left. Now I implemented justification using some code from net. I tried it on english editor, it works fine. But when I use it for my Urdu editor the text alignment changes to left. The code is here
Enum TextAlign
Left = 1...
This did the trick for me
Private Sub fontStyle(ByVal rtb as RichTextBox, ByVal style As FontStyle)
Dim selectionStart as Integer = rtb.SelectionStart
Dim selectionLength As Integer = rtb.SelectionLength
Dim selectionEnd as integer = selectionStart + selectionLength
Dim count as Integer = 0...
Oooooops sorry i posted the code for italics instead of bold. Ok so i hav searched the net and found that when mixed fonts are selected than SelectionFont will be nothing so i hav to write my own code to break down the selection to get individual fonts. So I'm gonna try that and if i hav anymore...
I hav used the following code for changing text to bold in an rtb editor. When i select text with multiple fonts it is not working. What maybe the problem?
Dim doc As frmDocument = Me.ActiveMdiChild
On Error Resume Next
If doc.Text1.Focused Then
If...
The code which i hav written is below
Imports System
Imports System.Windows.Forms
Imports System.Runtime.InteropServices
<Serializable()> _
Public Class RichTextBoxEx
Inherits RichTextBox
Enum TextAlign
Left = 1
Right = 2
Center = 3
Justify = 4
End...
Thnx alot. I hav one more problem in code conversion. I hav to convert this code too
SendMessage( new HandleRef( this, Handle ),
EM_GETPARAFORMAT,
SCF_SELECTION, ref fmt );
I need to convert this code frm C# to VB 2005
[DllImport( "user32", CharSet = CharSet.Auto )]
private static extern int SendMessage( HandleRef hWnd,
int msg,
int wParam...
I am developing an MDI editor and i want to add the functionality to allow user to insert as many textboxes into richtextbox as he wishes using mouse. I have added following code to accompish this
Form1 has one richtextbox named RichTextBox1
Public Class Form1
Private i As Integer...
In keypress event of rtb, i want to detect the keypress and change the char printed e-g if i enter e then i want to change it to b. i can detect the key pressed by using keyascii = asc(e.keychar) but then how to set it to different value?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.