Click here to Skip to main content
15,888,968 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionreplacing single instance of a substring in a string Pin
Mustafa Ismail Mustafa18-Sep-07 22:01
Mustafa Ismail Mustafa18-Sep-07 22:01 
AnswerRe: replacing single instance of a substring in a string Pin
Mustafa Ismail Mustafa18-Sep-07 22:13
Mustafa Ismail Mustafa18-Sep-07 22:13 
Questiondeploying application. Pin
d_smit18-Sep-07 21:36
d_smit18-Sep-07 21:36 
AnswerRe: deploying application. Pin
GuyThiebaut19-Sep-07 0:18
professionalGuyThiebaut19-Sep-07 0:18 
GeneralRe: deploying application. Pin
d_smit19-Sep-07 2:56
d_smit19-Sep-07 2:56 
GeneralRe: deploying application. Pin
JamesS[C1]20-Sep-07 3:20
JamesS[C1]20-Sep-07 3:20 
Questioncode to print Pin
Faruzzy18-Sep-07 20:40
Faruzzy18-Sep-07 20:40 
AnswerRe: code to print Pin
C1AllenS18-Sep-07 22:27
C1AllenS18-Sep-07 22:27 
Hello,

To print the text in a textbox, you would have to use the PrintDocument object. Using the
PrintPage() event for this object, you can set the printing preferences and the text to be
printed.

Lets say, you have a Textbox and a Button placed on a form. Drop a PrintDocument object on
the form from the toolbox.

In the Button_Click event, write the following code:

Me.PrintDocument1.Print() ' PrintDocument1 is the name of the PrintDocument Object.

Now in the PrintPage() event for PrintDocument1 object, place the following code:
(You can double click on the PrintDocument1 to get to the event)

Dim control As Control = TextBox1 ' you can change this to control of your choice
Dim myfont As Font = control.Font
Dim mybrush As New SolidBrush(control.ForeColor)

e.Graphics.DrawString(control.Text, myfont, mybrush, 12, 12)
mybrush.Dispose()

I believe this should help.

Regards,

Allen Smith

Software Engineer
ComponentOne LLC
www.componentone.com

QuestionHoverGradientButton Lybra.Forms.controls.Hovergradient Pin
Faruzzy18-Sep-07 20:37
Faruzzy18-Sep-07 20:37 
AnswerRe: HoverGradientButton Lybra.Forms.controls.Hovergradient [modified] Pin
Dave Kreskowiak19-Sep-07 2:03
mveDave Kreskowiak19-Sep-07 2:03 
QuestionSharing window folder Pin
helelark12318-Sep-07 19:36
helelark12318-Sep-07 19:36 
AnswerRe: Sharing window folder Pin
Dave Kreskowiak19-Sep-07 2:01
mveDave Kreskowiak19-Sep-07 2:01 
GeneralRe: Sharing window folder Pin
helelark12319-Sep-07 3:15
helelark12319-Sep-07 3:15 
GeneralRe: Sharing window folder Pin
Dave Kreskowiak20-Sep-07 10:28
mveDave Kreskowiak20-Sep-07 10:28 
QuestionComboBox With PropertyGrid Control Pin
VB 8.018-Sep-07 18:00
VB 8.018-Sep-07 18:00 
AnswerRe: ComboBox With PropertyGrid Control Pin
Dave Kreskowiak19-Sep-07 1:56
mveDave Kreskowiak19-Sep-07 1:56 
GeneralRe: ComboBox With PropertyGrid Control Pin
VB 8.019-Sep-07 4:47
VB 8.019-Sep-07 4:47 
GeneralRe: ComboBox With PropertyGrid Control Pin
Dave Kreskowiak19-Sep-07 7:16
mveDave Kreskowiak19-Sep-07 7:16 
GeneralRe: ComboBox With PropertyGrid Control Pin
VB 8.020-Sep-07 2:42
VB 8.020-Sep-07 2:42 
GeneralRe: ComboBox With PropertyGrid Control Pin
Dave Kreskowiak20-Sep-07 9:44
mveDave Kreskowiak20-Sep-07 9:44 
GeneralRe: ComboBox With PropertyGrid Control Pin
VB 8.026-Sep-07 4:46
VB 8.026-Sep-07 4:46 
GeneralRe: ComboBox With PropertyGrid Control Pin
Dave Kreskowiak26-Sep-07 12:59
mveDave Kreskowiak26-Sep-07 12:59 
GeneralRe: ComboBox With PropertyGrid Control Pin
VB 8.026-Sep-07 21:09
VB 8.026-Sep-07 21:09 
GeneralRe: ComboBox With PropertyGrid Control Pin
VB 8.027-Sep-07 0:24
VB 8.027-Sep-07 0:24 
GeneralRe: ComboBox With PropertyGrid Control [modified] Pin
Dave Kreskowiak27-Sep-07 1:42
mveDave Kreskowiak27-Sep-07 1:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.