C# - Finding RTF Code Associated With Selected Text In RichTextBox

Mar 7, 2011

I am using winform RichTextBox and I wonder if we can find the corresponding rtf code (or at least whereabouts of it) when selecting text?

View 1 Replies


ADVERTISEMENT

VS 2008 Finding Text In RichTextBox?

Aug 29, 2009

Is there anyway I could find text in a RichTextBox? I want to put the code in here

[code]...

View 10 Replies

Deleting Selected Text In RichTextBox

Oct 7, 2006

I want to know that how can I delete selected text in a richtextbox.

View 6 Replies

Replacing RichTextBox Selected Text With ST?

Mar 31, 2010

I need to make it so it will replace RichTextBox1's selected text with: <ST>, where ST is the initially selected text.

View 3 Replies

Color Dialog And Selected Text In Richtextbox?

Jun 6, 2011

i'm trying to only change the color of the selected text in a richtextbox using the color dialog.. this code changes all the text..

Dim dlgcolor As New ColorDialog
dlgcolor.Color = PictureBox4.BackColor
If dlgColor.ShowDialog() = DialogResult.OK Then

[code].....

View 1 Replies

Differences In Selected Text In Textbox And RichTextBox?

Sep 2, 2007

I have a form with a Textbox, RichTextBox, and a CopyToolStripButton.When I select text in the TextBox control, I can right click the mouse to get a menubox (cut, copy, paste, delete, select all) but when I select text in the RichTextBox and right click the mouse I do not get a menubox.Is this simply a difference in the controls, or do I need to enable a property on the RichTextBox to get this functionality?

This difference between Textbox and RichTextBox is evident even without the CopyToolStripButton code, so I am guessing it might have something to do with inherent or default properties of the controls themselves.At any rate,I would like to get this funcionality for the RichTextBox control as well.

View 12 Replies

How To Get A RicHTextBox To Multi Highlight Selected Text

May 1, 2009

How can I get a RicHTextBox to Multi Highlight selected text? [code]

View 5 Replies

RichTextBox,: Pass Fontname To Function To Change Selected Text?

Oct 14, 2010

I've been trying to convert my VB6 code to VB10, I'm stuck on how I should write it so I can pass a font name to my

function, So far this is what I have and not sure where to go from here. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

[Code]...

View 5 Replies

Code Selection Of Text Within A RichTextBox?

Mar 26, 2009

How do you code selection of text within a RichTextBox. I tried the following code and nothing happens.I would think this should select all text within the RichTextBox.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.RichTextBox1.SelectAll()
End Sub

I would think this would select text from a start point to an end point.

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ss = Convert.ToInt16(TextBox1.Text)
se = Convert.ToInt16(TextBox1.Text)
Me.RichTextBox1.Select(ss, se)
End Sub

View 1 Replies

Asp.net - Finding A .net Code To Add Existing Buttons/text Boxes/drop Down Lists, Etc To A Container Or Holder?

Jun 17, 2012

I'm using vb.net. Basically, I have a drop down list, text box and a submit button. You choose a movie director from a drop down list, then type in a movie, click button and it adds the data to my database.There's another button which hides/shows drop down list, text box and submit button using Visible = True and Visible = False, but what I don't like about it is when it hides the things I said before, it leaves some white/empty space like if they are still there, but not visible.Is there anyway to put some kind of holder/container and place a button which when clicked could add my drop down list, text box and submit buttons to that place?

View 1 Replies

VS 2010 RIchtextbox: Text Style (Only In Code)?

Oct 13, 2010

Say I have certain features that makes some things and prints it into a text box, how do I design some of the text at will? like hare:

----------------------------------------------------------
design

no design

----------------------------------------------------------

(i want to change color,font and bold)

View 31 Replies

Appending Text To A RichTextBox In A Different Thread And Code File?

Sep 28, 2011

With the intention of creating a program to interface with a serial port device, I recently started learning vb.net. To keep the structure neat the vb code has been split into two places; the first is the code behind for initialising, clicking buttons etc., whilst the second is for managing the comm port. Respectively, these are named 'MainWindow.xaml.vb' and 'ComPortManager.vb'.

In 'comPortManager.vb':
Dim RXArray(2047) As Char ' Array to hold received characters
Dim RXCnt As Integer ' Received character count

[code].....

View 1 Replies

Richtextbox Finding And Capitalizing A Word?

Apr 11, 2009

I think this capitalizes the first letter in the word "trUe" and makes the rest of the letters lowercase. Like: True

Dim strName
strName = "trUe"
strName = StrConv(strName, vbProperCase)

How would I make it so that if trUe is entered into the RichTextBox1 then it is automatically converted into: "True" ?

View 1 Replies

Keep Color Syntax In Richtextbox When Finding And Replacing Words?

Aug 21, 2009

when i copy code from vb.net code window, and paste it in my richtextbox, the color synthax is as it displays in my vb.net code window.. this i want to keep when finding and replacing words. i have the following code to find and replace,

RichTextBox1.Text = RichTextBox1.Text.Replace("Private Sub", "<font color=blue>Private Sub</font>")

but the color syntax of the richtextbox code is lost, looks like a textbox's text.. how do i replace the words and keep the synthax coloring?

View 5 Replies

VS 2010 : Finding Multiple Instances Of Same Word In RichTextBox?

Nov 13, 2010

txtSubject1Info.SelectionStart = txtSubject1Info.Find("Hey!")

I am finding specific words in the RichTextBox (in this case, "Hey!") and selecting them by getting their initial position through the "Find" command. Unfortunately, this does not work when I have multiple instances of "Hey!" in the RichTextBox. Here's an example:

Text in RichTextBox:
Hey! This is cool!

The Find command would return a value of 0 in this case. However, let's take a look at another scenario:

Text in RichTextBox:

In this case, the Find command would return a value of 0 again, but I want it to get the initial position of the second "Hey!" statement. I'm wondering how I can do this.

View 4 Replies

Shop Code - List Of Selected Products Will Be Saved In A .text File

Jul 31, 2008

I've got 2 seperated programs.

One is a program where you can select a product and select how many of them you want. Then the total price wil be displayedin a label. And the list of selected products will be saved in a .txt file.

The second program is an Edit program. The user can edit his selected products. Here he can change the total of a product.So if he had selected 1, he can change it to three or something. When the user clicks the button Save. The changes will besaved in the same .txt file and the total price will also be changed and displayed in program one.

Program one is compleet.Program two has problems and here i need your help:- the user can't make a change in the numbers, seems that the textbox is read-only or something. How to solve?- Then when i click save, the changed must be saved in the .txt ( i can't test this yet because no changes can't be made)- the total new price must be showed in program 1 (i think i programmed this well, but can you take a look)

Here is a part of my code of program 1:

CODE:

View 3 Replies

VS 2008 - Finding Last Latter Of Selected Path

Jun 19, 2010

I have FolderBrowserDialog1, how do I find the last latter of FolderBrowserDialog1.SelectedPath?

View 1 Replies

VS 2010 Finding WebBrowser On The Selected Tab?

Jul 18, 2010

I need to have the webbrowser on the selected tab dimmed, so like Dim foundbrowser = TabControl1.SelectedTab.Controls.Find("WebBrowser", False)i know thats totally wrong but its just to show you what i kind of need, how do i do this? The only control on the selected tab is a webbrowser if that helps?

View 2 Replies

Get Text From Richtextbox In A Form To Another Inside A Richtextbox?

Jul 25, 2011

I am creating a text editor like notepad. Well its an advance type because it is a tabbed notepad type. It saves html files.

I only created tabcontrol on the design time named TabControl1. the tabpages and the richtextbox are created on the form load and when adding tabs. [code]...

View 7 Replies

Set Text To A Richtextbox In Form To Another Inside A Richtextbox?

Jul 26, 2011

I have 2 forms. The 1 is named frmMain. inside of it is a Richtextbox named RTB.

The other form is named frmInsert. Inside of it is a Richtextbox named rtbtext.[code]..

View 5 Replies

RichTextBox - Copy All Selected Textbox

Jan 4, 2011

Here is what I got so far:
1) I have a VB2010 Project. The form contains the following things:
1 RichTextBox (RichTextBox1) 8 Buttons (Colors: Red, Green, Yellow, Blue, Teal, Pink, White, Black) (Button1 until Button8)
1 Button "Copy Selected Text" (Button9) 1 TextBox (TextBox1) 1 Button "Copy Finished Text to Clipboard" (Button10)

2) Here is how the program should work:
I write some text into the RichTextBox I select specific parts of the text, click one of the 8 color buttons and the selected text becomes that color. I do that until all the text is randomly colored e.g: Red Green Yellow Blue Teal Pink White Black
I select all of the text "RedGreenYellowBlueTealPinkWhiteBlack" I press the "Copy Selected Text" Button (Button9) The selected text should become visible in the TextBox like this: ^1Red^2Green^3Yellow^4Blue^5Teal^6Pink^7White^8Black
I press the "Copy Finished Text to Clipboard" (Button10) The character count (length) of the TextBox1 should not exceed 32 characters. If it does show message box. The whole TextBox1 should be copied. If the text is successfully copied, show MessageBox with "Success" else show MessageBox with "Error".

View 6 Replies

Change All Links Colors In Richtextbox But Not One Selected?

Aug 2, 2011

Code to replace the link colors and text colors?Here's the code I found.it works but it only changes the color of one link.I need to change all the colors of all links.[code]...

View 1 Replies

How To Copy Contents Of Individually Selected RichTextBox

Aug 10, 2011

I have 42 RichTextBoxes (RTBs) and I would like to add my ContextMenuStrip to each of them (which I have already done), but the problem I am having is when the application is running and the ContextMenuItem "Copy" for example is clicked, I can only make it copy the context of one of the RTBs, when I would like it to copy the contents of any individual one. So as I mentioned, I have 42 RTBs, but I am having trouble getting the contents of the focused RTB. The below code is just copying the 1 RTB and when I Copy on another RTB, it copies the contents of RTB1.

I originally started out with like so, but is just for the one RTB and when I add more than one in the code below it's even more of a disaster..
Private Sub Copy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Copy.Click
RichTextBox1.Copy()
End Sub

I tried using this, but I was not sure how to add the copy function into it:
Private Sub Copy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Copy.Click
Try
For Each itm As Control In EnumerateAllControls(Me)
For Each c As Control In itm.Controls
If TypeOf c Is RichTextBox Then
[Code] .....

How to Copy ContextMenuItem to focus on the user focused RTB.

View 3 Replies

Change The Selected Value To Upper Case In The Richtextbox In 2008?

Sep 15, 2010

i need to change the selected value to upper case in the richtextbox i use the code

Dim tou As String
Dim tot As String
tou = RichTextBox1.SelectedText
tot = tou

[code]....

View 1 Replies

Richtextbox SelectionFont.Size When Multiple Sizes Are Selected?

May 26, 2010

When a selection in WindowsForms RichTextbox uses two or more different font sizes (eg. you select text with font size 9 and some other text with font size 16 in the same selection), SelectionFont.Size always returns 13.

View 2 Replies

VS 2008 - Change Multiple Selected Fonts In Richtextbox

May 17, 2012

iam using this code to change the font in a richtextbox it's work if user select a single font if there are multiple fonts, and font sizes it dosenot work

[Code]...

View 13 Replies

Finding A Value Of Line Of Code?

Jun 22, 2010

Me.pass = Conversions.ToString(CDbl((((Conversions.ToDouble((4 & 3)) - Conversions.ToDouble(4)) + (Conversions.ToDouble(2) * Conversions.ToDouble(1))) / Conversions.ToDouble(2))))

[code].....

View 1 Replies

Finding Erlang B Code?

Dec 6, 2006

I've been looking for a code example that would run through the Erlang B formula, but the only thing I can find are commercial packages.

View 8 Replies

Finding The Code Snippet?

Jun 23, 2010

I am working on a little small 10 question quiz. The quiz is just for fun for a work thing I'm doing. I'm using VB.net. I'd like to put in one of the questions something like "what's your favorite baseball team?" Then list 3 radio buttons for 3 possible answers. But I'd like to make 2 of the radio buttons move away when a person tries to mouse over it to click on it. So only the answer I want them to use would be possible. I can creat it all but the code to make the raido buttons move when moused over. I've been searching but having trouble finding anything on how to do this.

I don't have my actual quiz code in front of me. But can post the form code for that question later tonight when I get home if needed. But the form is very basic. just has the question in a lable, Then the 3 answers below it as radio buttons. I have a next button that goes to the next form and closes the previous one, and an exit button that closes down the whole application.

View 10 Replies

Finding A Control Within A FormView From Code-behind?

Jun 24, 2009

Here the code behind... I'm trying to retrieve this control so I can add items to the drop down list (I'm retrieving the Role Groups to add to the drop down list in the code-behind)

Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim DDRoleGroups As DropDownList

[code].....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved