VS 2008 : RichTextBox Formatting In A Loop?

Jun 23, 2011

i am trying to display a line of smiley faces ☻ and change the colour of each face, i cant use a find method as there are 10 of these smilies so i thought about using a loop and selecting only the last one entered and changing its colour. here is a simplified version of my

VB.Net
For a = 0 to 9
RichTextBox1.Text += "☻" ' add the smiley

[code]....

This when i ran it changes the first nine to the first colour in the array and correctly does the colour of the last smiley? could i for instance format the character first then add it formatted?

View 2 Replies


ADVERTISEMENT

VS 2008 RichTextBox Clears Formatting When Changing Font?

Nov 25, 2009

I have a richtextbox with multiple colored text in it. When I change the font, the color table is removed and everything changes to the default fore color. Anyone know of a why to preserve the color table and formatting when changing the font? I know I could build the RTF manually, but I really want to avoid that if possible.

View 2 Replies

C# - Formatting Richtextbox In WPF?

Jan 22, 2010

I have a Dynamic Fields comming from database. These fields populated on RichTextBox after changing the color.Means Different Fields in Different Color.

View 1 Replies

RichTextBox Formatting?

May 5, 2010

At the moment i am doing my IT PROJECt for college and i need my project not only to work but look good.

CVBox.AppendText(TextBox1.Text & vbNewLine & data & vbNewLine & ComboBox1.Text & vbNewLine &
nationality & vbNewLine & vbNewLine & TextBox5.Text & vbNewLine & "Tel. " &

[code].....

View 1 Replies

VS 2010 RichTextBox Formatting?

Apr 9, 2011

I've developed a MySQL chat app that I have in my program. It works perfectly, however all of the text is the same color. I use a silver-on-black scheme. I'd like to do 1 of 2 things, whichever one is.. er.. "more possible". The first option would be simple - alternate each row's back color. So that one row would be silver-on-black, the next row would be black-on-silver, and so on alternating. Each row is separated by a "vbCrLf". The second option would be to merely bold or turn to white the info text. Here's the format of the chat messages: [{time} - {user}] {message}. I would want [{time} - {user}] to be bold and white. Are either of those 2 options possible? Well, I know they're possible

View 1 Replies

Copying Text Along With Its Formatting From A RichTextBox

Feb 5, 2011

How to copy the text in a RichTextBox along with its formatting to a wordpad or webbrowser?

View 1 Replies

Forms :: RichTextBox Markup Formatting?

Jul 29, 2009

I am trying to bind a RichTextBox to data from an XML file where text within a paragraph may be tagged with formatting tags. As an example the text may look like this:"The size of the area is 5000 m<superscript>2</superscript>".Text may also contain other formatting tags such as <bold> or <italic>:"The quick brown fox <bold>jumps</bold> over the <italic>lazy</italic> dog".

View 5 Replies

RichTextBox Formatting - Selection Font Gets Set To Nothing

Dec 15, 2010

I have a RichTextBox. I process all the formatting and everything works fine. There is an exception. When I have selected text that have two states of formatting in it, the SelectionFont member is set to Nothing. I notice that WordPad recognizes this condition
and kindof greys out the affected format.

Let's take this example:
This text is in Bold.
The rest of the comments here and not in bold.

When I select these two lines, the SelectionFont gets set to Nothing. WordPad sets the Bold button grey, but still clickable. If I click the Bold button in this state, the entire selection is set to bold. How do I achieve this same functionality?

View 3 Replies

VS 2010 Formatting Parts Of A Richtextbox?

Jun 7, 2011

I have some text displayed in a richtextbox from an xml. This is how is shows upHaste <i>(As soon as it comes under your control.)</i>At the beginning of the end step<i>The storms of the wastelands form quickly and hit hard. Few have anything to do with rain.</i>

View 1 Replies

RichTextBox - Send Email But With HTML Formatting

Jun 24, 2010

I have an Emailer in my Application and it has a richtextbox which the user can add fancy colours, font, pics etc... but when I send the email it doesn't send it as HTML. Is there a property in the richtextbox that lets me access the HTML code so that the email is sent as HTML and not just plain text. I need to be sending the emails as it appears in the richtextbox.

I am using the following code
Dim moApp As Outlook.Application
Dim oEmail As Outlook.MailItem
moApp = CreateObject("Outlook.Application")
oEmail = moApp.CreateItem(Outlook.OlItemType.olMailItem)
[Code] .....

And I get the following email Without HTML. Please look at the Emailer to see that it is formatted. So I need to send the content of the Emailer as HTML via outlook.

View 6 Replies

Apply Colour Formatting To A Richtextbox *as User Types*?

Oct 18, 2010

I have a RichTextBox with an OnChanged event. The OnChanged event should look at each line in the RichTextBox and if the line is of prime length colour it red, otherwise colour it black. How do I do this? I think it is possible to select from index a to index b and set selection colour, but I think this will lose my cursor position.

View 2 Replies

RichTextBox - Formatting Data From Access Database Field

Oct 29, 2010

Using VB 2008, I have a form which includes a richtextbox which is bound to a database field. When i bind the datafield to the richtextbox, I get an unformatted display unlike the control in VB6. How can I bind the data from the database to the richtextbox so that it displays formatted?

View 1 Replies

Saving Richtextbox Data Inside A Database Along With The Formatting?

Jun 21, 2010

I have a rich text box in one of my applications (WPF). Now I want to store the data of the rich text box along with its formatting (e.g. bold, colored etc.) into a database (SQL Server). Currently I am storing the whole XAML of the text box in a database field. however, I am not sure whether this is the right approach.

View 2 Replies

VS 2005 Merge / Append Two RichTextBox's And Preserve Formatting

Jul 22, 2009

I have two RichTextBoxes, each of which can have any sort of formatting. I need to be able to take the rich text from box 2, complete with formatting, and add it to the end of box 1, preserving the formatting of both box 1 and the appended rich text.

I've not managed to find anything usefull on this anywhere apart from hints pointing to manually re-building the RTF codes for the result (but no actual VB / C# / C code to perform this or similar).

View 5 Replies

.net - WPF RichTextBox - Iterate Through The Text's Words And Change Their Content And Formatting?

Nov 1, 2010

I have a WPF RichTextBox which contain in its FlowDocument both text and images. I need to iterate through the text's words (those which builds the text which the user see on the screen) and change their content and formatting. For instance, change the word "room" to the word "home", applying to the last a red color.

I need to change words whether they are formatted or unformatted.For instance, if a word is in Italic, colored, or just regular black text, it makes no difference for me.Each word will be replaced with one which have about identical length, so I don't want that this operation will effect the general page layout. All images and other objects should remain at their positions.It is preferred that the process of this operation will not be visible to the user. Only its result should be visible (i.e, no visible selections of text).If this operation can be done either directly on the FlowDocumet or with properties/methods of the RichTextBox, the simple one is preferred (but exmaples for both will be ideal).

View 1 Replies

Richtextbox Control: Bold / Italic Formatting Lost On Save?

Aug 11, 2009

i have a RTB in my application for notes. Ive put it in a panel with a toolstrip and buttons for bold, italic, underline etc.This works fine,

[Code]...

View 14 Replies

Richtextbox Scroll - But Then Loop?

Sep 12, 2011

I would like to be able to vertically scroll some text in a richtextbox control in a loop so when it reaches the last line in the richtextbox it jumps back to line 0 and starts over, I can figure out the scrolling using code:

[Code]...

Which is placed in a timer but I am not sure how to reset the scrolling back to the top once it has been through all the lines of text. Using the above code just seems to go on forever even if there is no more text to show... I tried setting the POINT values to 0 but that does not help.

Has anyone got some ideas on how I can do it, I want to use this code as it gives a nice smooth scroll efect.. how can I reset the scroll position back to 0/the top of the richtextbox?

View 1 Replies

RichTextBox Control "loses" Special Formatting After Enabling WordWrap

Jun 11, 2011

I've been developing a text editing application and my problem is that the RichTextBox control will "lose" all special formatting (like font, color etc.) when enabling WordWrap.

View 3 Replies

VS 2010 : RichTextBox Edit Line By Line, Keeping The Formatting?

Jul 7, 2011

I want to loop the lines of my RTB and add a vbTab on each line.How do i do this?

View 1 Replies

Loop Through Array With Addresses In It Then Display Them On A Richtextbox?

Feb 8, 2009

However, it loops through does the first one .... then I have to click the button event again for it to get the 2nd one BUT THEN when I click button the 3rd time it doesnt do the third address it simply repeats number 2

View 5 Replies

Converting C++ Printf Formatting To / From String Formatting

Sep 30, 2010

I have some VB .NET software that interfaces to a load of old (but sound) COM objects. The VB provides a GUI for the COM objects, part of which consists of setting various options on the COM objects - several of which relate to string formatting.I have a simple pair of VB .NET functions that convert basic %f, %d, %g formats to/from .NET equivalents using a large select case covering specific common strings, but they don't cover all formats.[code]Before I start diving in and making it more versatile with some parsing, does anyone know of a class (eg VB or C# .NET) that provides a decent ready-made implementation? Or perhaps some regexp wizadry could be used?

View 2 Replies

VS 2008 Program Works Before Loop But Not After Loop

Aug 11, 2009

I assigned an integer as 1, and looped my program using:[code]I can recieve the packets without looping, but once i loop, i receive nothing.

View 29 Replies

VS 2008 Visual Studio 2008 Text Formatting?

Jan 5, 2010

if this is not the right area to be posting this. I couldn't find an area dedicated to discussion about IDE features.Somehow one of my .vb files is not showing the nice formatting that is default in VS2008, such as the text colors, etc. how I can get this back? I don't know what to search for, as I don't know what its actually called. On the left you see what I want, and on the right you see what I have right now.

View 4 Replies

2008 Percentage Formatting

Jan 28, 2009

I have a program that is calculating the cost of a certain number of plane tickets, the validation and basic calculations are fine the only problem i've got this: There is a discount text box field called "txtDiscount" where IF a user enters a number it will discount this as a percentage off the total cost of all the tickets, but I cannot get it to work [Code]

View 2 Replies

Date Formatting In VB 2008?

Apr 4, 2009

have a really annoying VB 2008 problem and I'm hoping someone knows how to solve this. I implement the following code:

Code:
DispArrDate = MonthArr & "/" & DayArr & "/" & YearArr
DisplayArrDate.Text = DispArrDate.ToLongDateString

So basically, I'm getting date information from the user and trying to convert it into a date format, and show it to the user in a text box which is obviously named "DisplayArrDate", and "DispArrDate" is a date variable and "MonthArr" & "DayArr" & "YearArr" are strings which are always numbers because they are selected from a drop down combo box.

Now, the code works perfectly on my computer and some others, but for some unknown reason, on some computers, even if they have the same local date settings, it gives me the error: "Conversion from string "4/13/2009" to type 'Date' is not valid.", that's just one example, where "13" is obviously the day. I use the month/day/year format because, in the toturial I'm reading, it tells me, that no matter my local date settings, when using VB 2008, the month/day/year format should always be used and it will display a date in the local format automatically. It seems that on some computers, this isn't the case, and the month/day format is creating errors.

View 1 Replies

VS 2008 Date Changes When Formatting?

Jul 15, 2009

formating a date here

Dim dt As DateTime
dt = dsTitles.Tables(0).Rows(0).Item("servicedate")
lbldate.Text = Format(dt, "dd/mm/yy HH:MM")

The original date is - 19/08/2008 00:00:00

the date that variable dt gets is - #8/19/2008#

the final result is - 19/00/08 00:08

View 5 Replies

VS 2008 Date Formatting From Var

Sep 30, 2011

Good day to all of you again, I've been looking into this problem for several hours now and I can't find what is wrong with my piece of code

[Code]...

View 2 Replies

VS 2008 Formatting A String?

Jan 4, 2012

I have this string "0.9874" and I would like to use vb code to change it to "0.9.8.74" so that it looks like a proper version number.How do I do this? String.Format("{???}",MyString) or perhaps:

View 8 Replies

VS 2008 Formatting A TimeSpan?

Jul 7, 2010

A TimeSpan by default shows hours, minutes & seconds when converted to a string. How do I show only hours & minutes? I tried ts.ToString("hh:mm") but that doesn't work.

View 7 Replies

VS 2008 Formatting Drive?

Aug 5, 2009

I want to make an application that allows you to format a drive.My application consists of a combo box (so user can select drive) and a format button to format the selected drive.

I would like to know is this possible and if so how?

View 3 Replies







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