|
-
Jun 21st, 2007, 11:19 AM
#1
Thread Starter
New Member
[2005] Help with imposting the size of the letters
Hi,I'm new to this forum
I would like to do a program style word pad.
The open/save and new file dialog works perfectly but now how can I do that when I click on button the size of the letters to write will be 20?If you can please write here the code.I know my English is bad but I'm trying to talk
Thanks in advance.
Last edited by matthiasu; Jun 21st, 2007 at 11:23 AM.
-
Jun 21st, 2007, 11:29 AM
#2
Fanatic Member
Re: [2005] Help with imposting the size of the letters
Add a numeric up down control to your form, and fill in the values for the size of the text you want them to be able to use. Detect when the value of the numeric updown changes and change the text size of your rich text box accordingly.
D
Platforms of choice: Visual Studio 2005/2008 Professional : Visual Studio 2010 Enterprise : PHP - Notepad++/WAMP
Please Rate If I helped you. 
Please remember to mark threads as closed if your issue has been resolved.
Reserved Words in Access | Connection Strings
-
Jun 21st, 2007, 11:39 AM
#3
Thread Starter
New Member
-
Jun 21st, 2007, 11:58 AM
#4
Re: [2005] Help with imposting the size of the letters
yes it is possible, simply set the textbox's Font property to a new Font that's a larger size
Look into the TextBox class and the Font class at MSDN
http://msdn2.microsoft.com/en-us/lib...trol.font.aspx
http://msdn2.microsoft.com/en-us/lib...wing.font.aspx
so you would want to do something like:
TextBox1.Font = New Font("Microsoft Sans Serif", 12, FontStyle.Regular)
or
TextBox1.Font = New Font("Microsoft Sans Serif", 14, FontStyle.Regular)
-
Jun 21st, 2007, 01:06 PM
#5
Hyperactive Member
Re: [2005] Help with imposting the size of the letters
vb.net Code:
Dim fontSize as Integer = 12
public sub buttonUP() handles button1.click
fontSize += 1
textbox1.Font = New Font("Microsoft Sans Serif", fontSize, FontStyle.Regular)
end sub
public sub buttonDown() handles button2.click
fontSize -= 1
textbox1.Font = New Font("Microsoft Sans Serif", fontSize, FontStyle.Regular)
end sub
to change the size up and down using buttons
*dont copy as is
you can just do on a button click
vb.net Code:
textbox1.Font = New Font("Microsoft Sans Serif", 20, FontStyle.Regular)
-
Jun 21st, 2007, 10:39 PM
#6
Re: [2005] Help with imposting the size of the letters
If you're imitating WordPad then presumably you are using a RichTextBox and you want to format only part of the text. In that case it would look like this:
vb.net Code:
myRichTextBox.SelectionFont = New Font(myRichTextBox.SelectionFont.FontFamily, newSizeHere, my.RichTextBox.SelectionFont.Style)
Note that things get complex when you have already formatted two sections differently, then you select part of each section and try to format them as one block. You can lose some formatting on one or both blocks depending on the circumstances.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|