473,396 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Bold Button Help

20
Okay i already made a discussion about this but this time.. i thought id be more acurate soo:

Im Using VB 2005 Express Edition
Im Making a Text Editor kinda like MS Word and Notepad Combined, So far i have Coded These Buttons:
New File
Open
Save
Save As
Close
Undo
Cut
Copy
Paste
Select All
View Textboxes
View Labels
View Images
View ToolBars (Basic & Advanced).

Anywho i want to add Bold, Italic And Underline to Both the Edit menu, and the Basic Toolbar, But that doesnt really matter, I just need help with the code for the button.

At the Moment i Have:
Expand|Select|Wrap|Line Numbers
  1.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.  
  3.         If RichTextBox1.Font.Style <> FontStyle.Bold Then
  4.             RichTextBox1.Font = New Font(RichTextBox1.Font, FontStyle.Bold)
  5.         Else
  6.             RichTextBox1.Font = New Font(RichTextBox1.Font, FontStyle.Regular)
  7.         End If
  8.  
  9.     End Sub
But Ofcourse this makes all the text in the RTB Bold and i would like my button to make SelectedText Bold..

Soo My Question Is!

Is there a way of making the code i already have apply to selected text INSTEAD of the whole RTB?


Thanks,


Prose!
Mar 8 '07 #1
2 1395
Prose
20
Soo no1 has any ideas?... this thing has been annoying me for ages.. please help!
Mar 8 '07 #2
willakawill
1,646 1GB
Soo no1 has any ideas?... this thing has been annoying me for ages.. please help!
Please read the posting guidelines before posting. Please copy your question to the original thread that you started. I am closing this thread.
Mar 8 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Imaya Kumar | last post by:
Hi, i'm developing an editor in VS.NET using Rich Text Box Control. I need to make a selected text Bold. how can i do this? also i will have an Italic Button too. If i click Bold button the...
6
by: Ronny sigo | last post by:
Hello all, I have made a form with a lot of entryfields and one button which, when clicked on, transforms all of the entryfields values into a MS Word document. All the formatting is done...
4
by: anthony | last post by:
hi, why can't i set the font of a button to bold at run time (it's read only), i can only set at design time. it can be done in vb6. thx
5
by: Stefan Mueller | last post by:
In HTML I use <b>...</b> to make parts of a text bold. <h1 class = "Style-MyText">This text is normal. <b>This text is bold.</b></h1> Now I'd like to do the same with a JavaScript. I tried...
5
by: James_Ptg | last post by:
Hello peole, i'm begin with VB.NET (before i was under ASP and VB) i have a -CheckBox- turned into a button with him properties Appearance. so i whant that the text become in Bold so i have...
5
by: Prose | last post by:
Hi, I want to make a Bold Button in a ToolStrip which will bold selected text in a RichTextBox then wen clicked again it will unbold the text, im using VB 2005 Express edition, can anyone help me?...
3
by: jonniethecodeprince | last post by:
Hello everyone. I want to change the style of a HTML element. I can change the paragraph alignment to left right, justify etc. But I can seem to find the code for any other style change, for...
5
by: sunadumari | last post by:
Hi folks, hope I'm in the wright section (I'm a newbie). I've got a textarea that, with the click on a button, shows the html-look of the data in the textarea. This script I found on the net (with...
1
jamesd0142
by: jamesd0142 | last post by:
Hi, im using a rich text box called "main", a button called "bold". when my program is running i want to be able to type in the rich text box, then when i highlight some text and press the bold...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.