hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Programming Tutorials : [VB] Rich Text Box - Two Tricks
Reply

Programming Tutorials How-Tos related to programming, databases, and the like.
Forum Jump

[VB] Rich Text Box - Two Tricks

Reply Post New Thread In Programming Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-22-2005, 02:41 PM
VisualBasic VisualBasic is offline
Newbie
 
Join Date: Sep 2005
Posts: 13

[VB] Rich Text Box - Two Tricks


In your form, or function simply do this to copy the text to the clipboard of Windows.

Code:
Clipboard.SetText ActiveForm.rtfText.SelRTF

Pasting is pretty much the opposite!

Code:
ActiveForm.rtfText.SelRTF = Clipboard.GetText
Want to print what's in your programs box?

Code:
If ActiveForm Is Nothing Then Exit Sub
    

    With dlgCommonDialog
        .DialogTitle = "Print"
        .CancelError = True
        .Flags = cdlPDReturnDC + cdlPDNoPageNums
        If ActiveForm.rtfText.SelLength = 0 Then
            .Flags = .Flags + cdlPDAllPages
        Else
            .Flags = .Flags + cdlPDSelection
        End If
        .ShowPrinter
        If Err <> MSComDlg.cdlCancel Then
            ActiveForm.rtfText.SelPrint .hDC
        End If
    End With

Reply With Quote


Sponsored Links
Reply

Related posts from TheWhir.com
Title Type Date Posted
WHD.global 2013: Open-Xchange Launches Browser-based Office Productivity Suite Web Hosting News 2013-03-20 06:55:56
Are you ready for Speed Networking at WHIR Events? Blog 2013-01-18 07:00:04
Irish Web Host LetsHost Sending Billing Reminders to Customers via Text Message Web Hosting News 2012-03-13 17:00:48
Google+ Business Pages – Implications for Search Marketing Blog 2012-01-25 09:58:46
Email Provider OpenXchange Partners with Openwave Web Hosting News 2011-10-12 17:23:08


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?