home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / texted1a / frmtext1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-10-12  |  3.0 KB  |  78 lines

  1. VERSION 5.00
  2. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "richtx32.ocx"
  3. Begin VB.Form frmText1 
  4.    Caption         =   "Document"
  5.    ClientHeight    =   2850
  6.    ClientLeft      =   1875
  7.    ClientTop       =   3945
  8.    ClientWidth     =   6510
  9.    Icon            =   "frmText1.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MDIChild        =   -1  'True
  12.    ScaleHeight     =   2850
  13.    ScaleWidth      =   6510
  14.    Begin RichTextLib.RichTextBox rtfBox1 
  15.       Height          =   2775
  16.       Left            =   0
  17.       TabIndex        =   0
  18.       Top             =   0
  19.       Width           =   6495
  20.       _ExtentX        =   11456
  21.       _ExtentY        =   4895
  22.       _Version        =   393217
  23.       ScrollBars      =   2
  24.       TextRTF         =   $"frmText1.frx":27A2
  25.    End
  26. Attribute VB_Name = "frmText1"
  27. Attribute VB_GlobalNameSpace = False
  28. Attribute VB_Creatable = False
  29. Attribute VB_PredeclaredId = True
  30. Attribute VB_Exposed = False
  31. Dim DocChanged As Boolean
  32. Private Sub rtfBox1_SelChange()
  33.     fMainForm.tbToolBar.Buttons("Bold").Value = IIf(rtfBox1.SelBold, tbrPressed, tbrUnpressed)
  34.     fMainForm.tbToolBar.Buttons("Italic").Value = IIf(rtfBox1.SelItalic, tbrPressed, tbrUnpressed)
  35.     fMainForm.tbToolBar.Buttons("Underline").Value = IIf(rtfBox1.SelUnderline, tbrPressed, tbrUnpressed)
  36. End Sub
  37. Private Sub Form_Load()
  38.     Form_Resize
  39. End Sub
  40. Private Sub Form_Resize()
  41.     On Error Resume Next
  42.     rtfBox1.Move 100, 100, Me.ScaleWidth - 200, Me.ScaleHeight - 200
  43.     rtfBox1.RightMargin = rtfBox1.Width - 400
  44. End Sub
  45. Private Sub Form_Activate()
  46.     fMainForm.StatusBar1.Panels(3).Text = Me.Caption
  47.     fMainForm.lblDocName.Caption = Me.Caption
  48.     fMainForm.tbToolBar.Buttons(9).Enabled = True
  49.     fMainForm.tbToolBar.Buttons(10).Enabled = True
  50.     fMainForm.tbToolBar.Buttons(11).Enabled = True
  51.     fMainForm.tbToolBar.Buttons("Bold").Value = IIf(rtfBox1.SelBold, tbrPressed, tbrUnpressed)
  52.     fMainForm.tbToolBar.Buttons("Italic").Value = IIf(rtfBox1.SelItalic, tbrPressed, tbrUnpressed)
  53.     fMainForm.tbToolBar.Buttons("Underline").Value = IIf(rtfBox1.SelUnderline, tbrPressed, tbrUnpressed)
  54. End Sub
  55. Private Sub Form_Unload(cancel As Integer)
  56.     fMainForm.tbToolBar.Buttons(9).Enabled = False
  57.     fMainForm.tbToolBar.Buttons(10).Enabled = False
  58.     fMainForm.tbToolBar.Buttons(11).Enabled = False
  59. If DocChanged Then
  60.     Select Case MsgBox("The file " & Me.Caption & " has changed!" & vbCr & vbCr & _
  61.             "Do you wish to save your changes?", _
  62.             vbExclamation + vbYesNoCancel, "-- " & Me.Caption & " has changed!")
  63.     Case vbYes
  64.         MsgBox "You Chose Yes :(. Oh Well.. Save After Exit not yet added! Due to a small problem :)"
  65. '        fMainForm.mnuFileSave
  66.     Case vbNo
  67.         Unload Me
  68.     Case vbCancel
  69.         cancel = True
  70.     End Select
  71. End If
  72. End Sub
  73. Private Sub rtfBox1_Change()
  74.     ' Changes the docchanged value to true for saving purposes.
  75. DocChanged = True
  76. fMainForm.mnuFileSave.Enabled = True
  77. End Sub
  78.