-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtmleditor.frm
146 lines (135 loc) · 4.06 KB
/
htmleditor.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1
Caption = "HTML Editor by Daniel"
ClientHeight = 5355
ClientLeft = 60
ClientTop = 345
ClientWidth = 8115
ClipControls = 0 'False
ControlBox = 0 'False
Icon = "htmleditor.frx":0000
LinkTopic = "Form1"
ScaleHeight = 5355
ScaleWidth = 8115
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton Command5
Caption = "Minimize"
Height = 375
Left = 2760
TabIndex = 5
Top = 4920
Width = 975
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 2640
Top = 4920
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton Command4
Caption = "Open"
Height = 375
Left = 3840
TabIndex = 4
Top = 4920
Width = 975
End
Begin VB.CommandButton Command3
Caption = "Save"
Height = 375
Left = 4920
TabIndex = 3
Top = 4920
Width = 975
End
Begin VB.CommandButton Command2
Caption = "Preview"
Height = 375
Left = 6000
TabIndex = 2
Top = 4920
Width = 975
End
Begin VB.CommandButton Command1
Caption = "E&xit"
Height = 375
Left = 7080
TabIndex = 1
Top = 4920
Width = 975
End
Begin RichTextLib.RichTextBox RichTextBox1
Height = 4695
Left = 120
TabIndex = 0
Top = 120
Width = 7935
_ExtentX = 13996
_ExtentY = 8281
_Version = 393217
Enabled = -1 'True
ScrollBars = 2
TextRTF = $"htmleditor.frx":030A
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Courier New"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
rep% = MsgBox("Do you want to quit?", vbQuestion + vbYesNo)
If rep% = vbYes Then
End
Else
Exit Sub
End If
End Sub
Private Sub Command2_Click()
Open App.Path & "\preview.html" For Output As #1
Print #1, RichTextBox1.Text
Close #1
Load frmBrowser
frmBrowser.Show
frmBrowser.brwWebBrowser.Navigate App.Path & "\preview.html"
End Sub
Private Sub Command3_Click()
CommonDialog1.Filter = "HTML Files (*.html)|*.html|HTM Files (*.htm)|*.htm)"
CommonDialog1.ShowSave
If CommonDialog1.FileName <> "" Then
Open CommonDialog1.FileName For Output As #1
Print #1, RichTextBox1.Text
Close #1
End If
End Sub
Private Sub Command4_Click()
CommonDialog1.Filter = "HTML Files (*.html)|*.html|HTM Files (*.htm)|*.htm)"
CommonDialog1.ShowOpen
If CommonDialog1.FileName <> "" Then
Open CommonDialog1.FileName For Input As #1
Do Until EOF(1)
Line Input #1, lineoftext$
alltext$ = alltext$ & lineoftext$
RichTextBox1.Text = alltext$
Loop
Close #1
End If
End Sub
Private Sub Command5_Click()
Me.WindowState = 1
End Sub
Private Sub Form_Load()
RichTextBox1.Text = "<HTML>" & vbCrLf & vbCrLf & "<HEAD>" & vbCrLf & "<TITLE>" & "Web Page</TITLE>" & vbCrLf & "</HEAD>" & vbCrLf & vbCrLf & "<BODY>" & vbCrLf & vbCrLf & "</BODY>" & vbCrLf & vbCrLf & "</HTML>"
End Sub