VB6 Richtextbox如何设置删除线
RichTextBox可以直接读取文件啊:RichTextBox1.FileName = "C:\Users\Administrator\Desktop\www.NewXing.com\6.txt"而且RichTextBox会自动把文件的ANSI编码转换为Unicode编码,无需你用StrConv转换(之所以慢就是因为StrConv)。
当然咯,如果数据确实是海量的,那么不管什么方法也仍然是慢的,博尔特10秒跑完100米可能很轻松,但你不可能要求博尔特跑200米也是10秒吧?
VB richtextbox 如何将字符转换为图片
展开全部 保存为图片那步不知如何做。
将下列代码粘贴到记事本中,将文件保存为form1.frm,再用VB打开。
VERSION 5.00Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"Begin VB.Form Form1 Caption = "Form1" ClientHeight = 3255 ClientLeft = 120 ClientTop = 450 ClientWidth = 5550 LinkTopic = "Form1" ScaleHeight = 3255 ScaleWidth = 5550 StartUpPosition = 3 '窗口缺省 Begin VB.PictureBox Picture2 Appearance = 0 'Flat BackColor = &H80000005& ForeColor = &H80000008& Height = 495 Left = 1800 ScaleHeight = 465 ScaleWidth = 1425 TabIndex = 4 Top = 2640 Width = 1455 End Begin VB.PictureBox Picture1 Appearance = 0 'Flat AutoRedraw = -1 'True BackColor = &H80000005& ForeColor = &H80000008& Height = 495 Left = 120 ScaleHeight = 465 ScaleWidth = 1305 TabIndex = 2 Top = 2640 Width = 1335 Begin VB.Label Label1 AutoSize = -1 'True Height = 180 Left = 0 TabIndex = 3 Top = 0 Width = 90 End End Begin VB.CommandButton Command1 Caption = "将选中文字转换为图片" Height = 495 Left = 3360 TabIndex = 1 Top = 2640 Width = 2055 End Begin RichTextLib.RichTextBox rt1 Height = 2415 Left = 120 TabIndex = 0 Top = 120 Width = 5295 _ExtentX = 9340 _ExtentY = 4260 _Version = 393217 Enabled = -1 'True TextRTF = $"Form1.frx":0000 EndEndAttribute VB_Name = "Form1"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseOption ExplicitPrivate Declare Function PrintWindow Lib "user32" (ByVal SrcHwnd As Long, ByVal DesHDC As Long, ByVal uFlag As Long) As LongPrivate Sub Command1_Click() Dim wScreen As Long Dim hScreen As Long Dim hdcScreen As Long Dim w As Long Dim h As Long Dim pic As PictureBox '窗体布局:一个富文本框,一个picture1,一个picture2,picture1中离了一个label1 '思路: '1、将富文本中选中的内容赋给label1.caption '2、将picture1的width和height设置成label1内容的大小 '3、通过printwindow(API函数)将picture1的内容复制到picture2 '4、将picture2的内容进行保存 '未完成的功能:将picture2保存为图片 Label1.Caption = Mid(rt1.Text, rt1.SelStart + 1, rt1.SelLength) Picture1.Width = Label1.Width + 20 Picture1.Height = Label1.Height + 20 Picture2.Width = Picture1.Width Picture2.Height = Picture1.Height '复制 PrintWindow Picture1.hwnd, Picture2.hdc, 0 '保存 SavePicture Picture2.Image, "c:\111.bmp "End Sub
转载请注明出处51数据库 » vb6 richtextbox word