home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 7230
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 10545
- LinkTopic = "Form1"
- ScaleHeight = 7230
- ScaleWidth = 10545
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command3
- Caption = "List All Objects"
- Height = 405
- Left = 150
- TabIndex = 5
- Top = 6090
- Width = 2265
- End
- Begin VB.CommandButton Command2
- Caption = "Load Text File"
- Height = 465
- Left = 5580
- TabIndex = 4
- Top = 6075
- Width = 2370
- End
- Begin VB.TextBox Text1
- Height = 2115
- Left = 5535
- MultiLine = -1 'True
- OLEDragMode = 1 'Automatic
- ScrollBars = 2 'Vertical
- TabIndex = 3
- Text = "OLEObjects.frx":0000
- Top = 3825
- Width = 4815
- End
- Begin MSComDlg.CommonDialog CommonDialog1
- Left = 8025
- Top = 3195
- _ExtentX = 847
- _ExtentY = 847
- _Version = 393216
- End
- Begin VB.CommandButton Command1
- Caption = "Load Image"
- Height = 465
- Left = 5535
- TabIndex = 2
- Top = 3240
- Width = 2370
- End
- Begin VB.PictureBox Picture1
- Height = 2940
- Left = 5535
- OLEDragMode = 1 'Automatic
- ScaleHeight = 2880
- ScaleWidth = 4800
- TabIndex = 1
- Top = 165
- Width = 4860
- End
- Begin RichTextLib.RichTextBox RichTextBox1
- Height = 5820
- Left = 120
- TabIndex = 0
- Top = 150
- Width = 5235
- _ExtentX = 9234
- _ExtentY = 10266
- _Version = 393216
- Enabled = -1 'True
- ScrollBars = 2
- RightMargin = 8e6
- TextRTF = $"OLEObjects.frx":0006
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim PWidth As Long, PHeight As Long
- Private Sub Command1_Click()
- CommonDialog1.Filter = "Images|*.bmp;*.gif;*.tif"
- CommonDialog1.InitDir = App.Path
- CommonDialog1.FileName = ""
- CommonDialog1.ShowOpen
- If CommonDialog1.FileName = "" Then Exit Sub
- Picture1.Picture = LoadPicture(CommonDialog1.FileName)
- Form1.Palette = LoadPicture(CommonDialog1.FileName)
- ResizePBox
- End Sub
- Private Sub Command2_Click()
- CommonDialog1.Filter = "Text Files|*.txt|All Files|*.*"
- CommonDialog1.InitDir = App.Path
- CommonDialog1.FileName = ""
- CommonDialog1.ShowOpen
- If CommonDialog1.FileName = "" Then Exit Sub
- FNum = FreeFile
- Open CommonDialog1.FileName For Input As #FNum
- Input #FNum, allTxt
- Close FNum
- Text1.Text = allTxt
- End Sub
- Private Sub Command3_Click()
- For i = 0 To RichTextBox1.OLEObjects.Count
- Debug.Print RichTextBox1.OLEObjects.Item(i).Class
- Debug.Print RichTextBox1.OLEObjects.Item(i).DisplayType
- RichTextBox1.OLEObjects.Item(i).FetchVerbs
- Debug.Print RichTextBox1.OLEObjects.Item(i).ObjectVerbs
- End Sub
- Private Sub Form_Load()
- PWidth = Picture1.Width
- PHeight = Picture1.Height
- End Sub
- Sub ResizePBox()
- Dim imgWidth As Long, imgHeight As Long
- Picture1.Enabled = False
- imgWidth = Round(ScaleX(Picture1.Picture.Width, vbHimetric, vbTwips))
- imgHeight = Round(ScaleY(Picture1.Picture.Height, vbHimetric, vbTwips))
- If imgWidth < PWidth Then Picture1.Width = imgWidth
- If imgHeight < PHeight Then Picture1.Height = imgHeight
- Picture1.Enabled = True
- End Sub
-