Forms :: Use Numericupdown To Multiply String In Richtextbox?

Feb 25, 2011

2 forms, on the first form I have a listbox which recieves it's items from a datagridview, when I click on a button all the items (in the listbox) are converted to a string and add to a richtextbox on the second form.

On the second form I have also a numericupdown, and here is what I run into.

With the numericupdown I want to multiply or remove blocks of strings from the richtextbox.

For example, when clicked on the button (form1) a string is add to the richtextbox, when I click (on form2) on the upbutton of the numericupdown I want to add the same string again below the existing one with 2 blank lines between them (this can be down a lot of times). When I click the downbutton, a string should be removed.

In short term, the amount in the numericupdown should be the amount of string blocks in the richtextbox.

Here is the code I use to copy listbox.items to string and add them to the richtextbox:

Public Sub SGLists()
Dim i As String
For Each i In Me.ListBox1.Items

[Code]....

View 12 Replies


ADVERTISEMENT

VS 2010 Multiplication In Forms - Multiply 2 User Input Numbers In Forms

Jun 22, 2011

I'm using VB 2010 and need to multiply 2 user input numbers in forms, so basically: TextBox5 = TextBox2 * TextBox3 That obviously didn't work but it shows what I want it to do.

View 3 Replies

VS 2005 : Can Multiply A String

Apr 18, 2009

Suppose I have a string, if I want to basically write it multiple times, depending on some integer value. How I can do that?For example:

dim STR1 as string = "</li></ul>"
dim INT1 as integer = 4
dim STR2 as string = " "

I would like to see the output as

STR2 = "</li></ul></li></ul></li></ul></li></ul>";

Can I achieve it in VB.NET?

View 3 Replies

Forms :: Use Inputted Data From The NumericUpDown Control In A Statement?

May 13, 2009

I have a NumericUpDown control with a range of 10-50 and I want to have the selected number be multiplied by an amount of money to create yearly cost. I dont know, however, how to use inputted data from the NumericUpDown control in a statement because I cannot convert it to Integer and I also dont know how to call in the data even if a number is selected.

View 3 Replies

Preserve Formatting From NumericUpDown To String?

May 15, 2012

My form contains several NumericUpDown controls. These controls show different amount of decimal places. Later in my code I put the different NumericUpDown.Value's in a string array arrStr() like so:

arrStr(1) = NumericUpDown1.Value
arrStr(2) = NumericUpDown2.Value
arrStr(3) = NumericUpDown3.Value

Then I print the array with the File.WriteAllLines function to a text file.
If for example NumericUpDown1.Value = 1.00, NumericUpDown2.Value = 2.30 and NumericUpDown3.Value = 2.124 the file has the following values in it:

1
2.3
2.124

[Code].....

I have tried Format which works, but that formatting method is not convenient as the amount of decimal places is already set for each NumericUpDown. It would be annoying to do the work again, but now with Format.

View 1 Replies

Convert String From A NumericUpDown Output To Date?

Dec 30, 2010

I'm writing. i'm using 3 NumericUpDown controls to get an output and convert it to a Date. i don't know if i am doing this right, and i've been working on this overnight. i'll put the codes that i've written[code]...

i'm trying to get the interval days between the two Dates (the Date today, and my birthday). the bolded texts are the ones that i want to know if i'm doing the right thing. because when i run the program, the error says "Format Exception was unhandled: String was not recognized as a valid DateTime".

View 3 Replies

Forms :: Use A If Statement To See If Fosters Button And Number 1 On The Number Pad Are Both Pressed Then Multiply Constant By Quantity Number?

Mar 4, 2011

I am doing a bar cash register and I want to use a if statement to see if fosters button and number 1 on the number pad are both pressed then multiply constant by quantity number

View 1 Replies

Forms :: What Is The Best Way To Update A RichTextBox

Oct 5, 2009

Yesterday I was working with a RichTextBox and decided to add some formatting to my logging (I've never formatted text in one before!! O_O) ...not quite what I expected! Now, normally I work with plain unformatted text and I have an imposed limit on the number of characters I allow to be displayed in the GUI log. So I did my usual thing: After the length exceeds my cap I remove all the oldest lines from the log and set the most recent log info as the .Text property of the RTB... FAIL! All formatting was lost and things were ugly looking again. Sigh.

[Code]...

View 1 Replies

Forms :: Create A Hyperlink In A Richtextbox?

Nov 7, 2009

I have got the code to create a Hyperlink in a richtextbox, I'll share it with you but to the experts, I have a question...

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dim newlabel as new linklabel
newlabel.Text = HYPERLINKNAME.text
newlabel.AutoSize = True

[code].....

I need to somehow get the NEWLABEL THAT THE PERSON CLICK!

View 5 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

Forms :: RichTextBox To Text File?

Apr 25, 2011

I have a My.Settings file that has a folder path that the user will select.I need to export text from a RichTextBox to a file, however, I can't seem to figure out how to use My.Settings as the path where the text file will be created.

Right now, I have:

Me.txtlog.SaveFile("C:UsersmycomputerDesktopNew folderfounditems.txt", RichTextBoxStreamType.PlainText)

which works fine, however, the My.Settings.destfolder is "C:UsersmycomputerDesktop estfolder"

I have tried:

Me.txtlog.SaveFile(My.Settings.DestinationFolder, RichTextBoxStreamType.PlainText)

but it doesn't work - and also I do not know how to name the text file from the above code.

View 8 Replies

Forms :: RichTextBox.SelectAll() SelectionFont Not Set?

Dec 10, 2010

I have a RichTextBox where part of the RichTextBox is Bold and the rest is not. If I do a SelectAll, the SelectionFont member doesn't get set.

In WordPad, with the identical Font and bolding set on part of the text, the SelectionFont appears to get set to the first font it finds in the selection...

View 2 Replies

Forms :: Update Richtextbox On A Different Thread?

Nov 2, 2011

Basic function - enter 5-10 urls. Download all web pages using multi threads and then process it. Then in the end, the text from all threads should end up in a richtextbox. It can't be done using any of my googly searches so i thought about asking this :

how would you update text in a richtextbox from a different thread?

I am being able to download and process web pages. But can't add it to richtextbox.

View 2 Replies

System.Windows.Forms.RichTextBox?

Jul 10, 2009

I did a conversion of a VB6 project to VB.NET 2005 and some properties of a RichTextBox control weren't upgraded. I was wondering if someone could tell me an alternative or what to do about the following properties of the RichTextBox:

ZOrder - this worked in VB6:
formMain.textStatusWindow.ZOrder(VB6.ZOrderConstants.BringToFront)
SelColor - this worked in VB6 fo example: formMain.textStatusWindow.SelColor = RGB(207, 73, 10)

View 4 Replies

Forms - RichTextBox Append Text At Cursor

Aug 18, 2010

Is it possible to append text into a RichTextBox1 where the cursor is? (Ex: In-putting a string from TextBox1 to RTB1 where the user has the typing cursor at.)

View 2 Replies

Forms :: Create A RichTextBox Editor Control?

Apr 20, 2011

I want to create a text editor control and I tried to download a RichTextBox control in vs 2008 but i can't find it fo free. any one can give me a link to download it for free.

View 6 Replies

Forms :: Insert Multiple Lines Into Richtextbox?

Mar 27, 2010

I'm working on a program that inputs a text box text into a RichTextBox via a button click. But when I click a button, it over writes the text that is already in the RichTextBox. How can I prevent this?

View 2 Replies

Forms :: Resolved Update Richtextbox On A Different Thread?

Nov 12, 2010

I've been searching around for ages now but can't seem to find what I'm looking for, anyway came accross this wonderful place so thought ay I'm creating a rewards system for school where pupil earn points for good behavior which they can then use to purchase things like a packet of pens. (They can also have points deducted for bad behavior)

View 2 Replies

Forms :: Richtextbox And Link Label Properties?

Dec 25, 2009

richtextbox and linklabel properties, please answer my question (following, in points) with a lot of detail because i'm really new to VB.NET...

[code].....

View 3 Replies

Forms :: Selecting Text In Richtextbox Which Is Underlined?

Apr 20, 2011

On a button click i want to first select "vb dotnet forums" and on next click immediately select "are the best" (in a richtextbox control) .

View 6 Replies

Forms :: Selecting The Underlined Text In Richtextbox?

Sep 24, 2011

i have a simple notepad application where i want a feature of selecting text which is underlined. Usually what happens is when i click a button the app reads a text file and underlines random text in the richtextbox. What i want is on the click of another button to select the text which is underlined. I thought of creating char range, regex all but not getting anywhere. I also dunno how to build a regex.

What i know is since all RTF texts are different we can choose the rtf text instead of simple text to select the underlined text. The rtf of underlined text in my application is this uli0 so manyulnonei where ul and ulnone mark the text as underlined. Now i want to select all such texts which are surrounded by uli0 and ulnonei . I thought of the following method :

1) Create another richtextbox2

2) Paste the text of richtextbox1 as rtf in richtextbox2. I mean show the text in coded rtf (like above) instead of normal rtf.

3) Use simple find to select all the text which is surrounded by ul and ulnone tags

4) process the text.

But this step is very tedious. If anyone could help me in making a simple procedure or build a regex which could process the text surrounded by those tags,

View 7 Replies

Forms :: Update RichTextBox With Invoke Using Parameters

Oct 5, 2009

I'm facing the problem of updating a RichTextBox (RTB) from a thread with parameters, I used invoke and methodinvoker:

[Code]...

View 11 Replies

Forms :: Making A Spell Checker For Richtextbox Control

Apr 22, 2011

i'am having trouble in making a spell checker for vb.net richtextbox control.I have made a form with richtextbox control and a panel control. I have put a listbox control in the panel control and filled with certain words. What iam able to do is whenever i select a word and click a button the panel appears just below the word (using get position from char) and display the choice. What iam not able to do is:

1) Select each word one-by-one whenever i click a button say F1 - I know keypress event but how do i select the words through keypress. I know they are separated by spaces but iam not familiar as to how to take advantage of it. The major problem being that there can be 2-3 words together sometimes colored as red. Eg: What i want is when i press F1 first time "this" is selected, next time "is" is selected and next time "nice car color" is selected. The two things are spaces and red color but i don't get anything from it.

2) Display the panel correctly within the main form's border. Right now when i select the last word of the sentence some part of panel disappears as it hides behind the main form. Eg - only 1/4th appears and rest hides. I can't find a way to limit it from moving when it has reached the main form size. I want to constrain it between top-bottom and left-right border of main form.

View 1 Replies

Forms :: Format Image / Picture Inside RichTextBox?

Feb 4, 2009

I just wanna ask, how to format an image or a picture inside an RTB control? Its like the way MSWORD does the formatting, (i.e Center, Behind Text, etc..).

View 8 Replies

Forms :: Programmatticaly Add Text To Richtextbox With Font Formats?

Oct 23, 2010

I am trying to add formatted text to a rich text box...

For instance, I want to add a heading as bold ("HEADING: ") and some data after it as regular ("REGULAR Data")...

I'd like to have a couple functions to perform the action.

When I use the below functions to add txt to a single rtf box, I get lines in either all bold or all regular. It doesn't seem to keep the font formatting after it adds text..

Public Function AddRegtxt(ByVal RTC As RichTextBox, ByVal Txt2Send As String)
With RTC
.SelectionStart = Len(.Text)

[Code].....

View 2 Replies

Forms :: RichTextBox - Search Feature And Match Case

Mar 28, 2011

Here's the situation: I've got a form that has
- RichTextBox
- OpenButton (to load RTF file)
- SaveButton (to save RTF file after editing)
- Textbox (for search phrase)
- SearchButton
- ExitButton
- 2 RadioButtons (WholeWord and MatchCase search)

All of them are working just the way I want them to except search features; I don't know how to write them properly. At the moment, they search and highlight only the first word they encounter. E.g. say I search for word "the" in the document, only the first "the" it encounters is highlighted. The rest is just untouched.

I understand this is because I've only got few lines of simple code as follows
If rtfText.Find(txtSearch.Text, RichTextBoxFinds.WholeWord) = -1 Then
MessageBox.Show("No results returned. Please try again.", "No matching results.", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If

I did try a few other snippets I found on the Internet including While loop but they didn't work as I wanted them to, and I couldn't understand them either. What I want is, which ever search option is used, when the matching result is found; it will highlight that word and when I click it again it will move onto another word. If I keep clicking, it will highlight the same words (but located in different areas) throughout the whole document and at the end, it will send back to the first matching word. Just like Adobe Reader search.

View 4 Replies

Forms :: RichTextBox Appending Text Inbetween Data?

Feb 15, 2011

I would like to know how it's possible to append text between data.

For example:

I have a RTB with "ABC" on the first line and "DEF" on the third line. My question is how would I insert text data into the second line, without changing any existing data.

View 1 Replies

How To Set Caret Position In A System.Windows.Forms RichTextBox

Oct 7, 2011

How do I set the caret position in a System.Windows.Forms RichTextBox? ScrollToCaret in not Working. Here are my Registry settings. When I save to the registry, It saves. When I try to get were I left off from the previous read, It leaves me at the beginning of the file and not where I left off. [Code]

View 2 Replies

Forms :: How To Save RichTextBox Formatted Text To Sql Server 2000

Sep 8, 2009

I am using vb.net 2005. In my form there is RichTextBox, when i write particular format with bold,diffrent font,color and save to sql server 2000 database with datatype 'Text' then formatted text not save in database.what is the way or source code to save formatted(rtf) text to databse, and how to display/retrive formatted(rtf) text back to RichtextBox.

View 1 Replies

How To Get Sub To Find String In RichTextBox

Jan 27, 2009

I need a sub that can find a string in a rich textbox. I can find a string with the function .find but I need to focus the other string with that name...
EX: Hi lol hi hi
I need to find the first hi, but if I want I need to find the second hi, but I don't know how I can do it....

View 1 Replies







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