) MyForm.BackColor = QBColor(ColorCode)
91/
Color Code udk,fpm;jyKeHygwfrsm;tm; Z,m;jzifh azmfjytyfygonf-
Number
Color
Number
Color
Number
Color
0
Black
6
Yellow
12
Light Red
1
Blue
7
White
13
Light Magenta
2
Green
8
Grey
14
Light Yellow
3
Cyan
9
Light Blue
15
Bright White
4
Red
10
Light Green
5
Magenta
11
Light Cyan
---------------0-0-0---------------
uGefysLwmvufpJG
160
yHk(179)
92/ yHk(179)yg Form wGif OptionButton, wd k Y j zif h wnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Option Button, Command Button toD;oD;wGif vdktyfaomy½dk*&rfrsm;udk a&;om;&ayrnf/ 93/
Option Button1 twGuf Private Sub Option1_Click() Form1.BackColor = QBColor(0) End Sub
94/
Option Button2 twGuf Private Sub Option2_Click() Form1.BackColor = QBColor(1) End Sub
95/
Option Button3 twGuf Private Sub Option3_Click() Form1.BackColor = QBColor(2) End Sub
96/
Option Button4 twGuf Private Sub Option4_Click() Form1.BackColor = QBColor(3) End Sub
97/
Option Button5 twGuf Private Sub Option5_Click() Form1.BackColor = QBColor(4) End Sub
161 98/
Option Button6 twGuf Private Sub Option6_Click() Form1.BackColor = QBColor(5) End Sub
99/
Option Button7 twGuf Private Sub Option7_Click() Form1.BackColor = QBColor(6) End Sub
100/
Option Button8 twGuf Private Sub Option8_Click() Form1.BackColor = QBColor(7) End Sub
101/
Option Button9 twGuf Private Sub Option9_Click() Form1.BackColor = QBColor(8) End Sub
102/
Option Button10 twGuf Private Sub Option10_Click() Form1.BackColor = QBColor(9) End Sub
103/
Option Button11 twGuf Private Sub Option11_Click() Form1.BackColor = QBColor(10) End Sub
104/
Option Button12 twGuf Private Sub Option12_Click() Form1.BackColor = QBColor(11) End Sub
Microsoft Visual Basic 6.0
uGefysLwmvufpJG
162
105/
Option Button13 twGuf Private Sub Option13_Click() Form1.BackColor = QBColor(12) End Sub
106/
Option Button14 twGuf Private Sub Option14_Click() Form1.BackColor = QBColor(13) End Sub
107/
Option Button15 twGuf Private Sub Option15_Click() Form1.BackColor = QBColor(14) End Sub
108/
Option Button16 twGuf Private Sub Option16_Click() Form1.BackColor = QBColor(15) End Sub
109/
Exit Command Button twGuf Private Sub Command1_Click() Unload Me End End Sub ---------------0-0-0---------------
yHk(180)
163
Microsoft Visual Basic 6.0
110/ yH(k 180)yg Form wGif CheckBox, wdkYjzifhwnfaqmuf xm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGif vdktyfaom y½dk*&rfrsm;udka&;om;&ayrnf/ 111/
Run Command Button twGuf Private Sub Command1_Click() If Check1.Value = 1 And Check2.Value = 1 And Check3.Value = 1 Then MsgBox "Eligible for the Housing Loan", , "Housing Loan" Else MsgBox "Not Eligible for the Housing Loan" End If End Sub
112/
Exit Command Button twGuf Private Sub Command2_Click() Unload Me End End Sub ---------------0-0-0---------------
yHk(181)
113/
yH k ( 181)yg Form wG i f wd k Y j zif h w nf a qmuf x m;NyD ; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGif vdktyf aomy½dk*&rfrsm;udk a&;om;&ayrnf/ 114/
Run Command Button twGuf Private Sub Command1_Click() Dim ret_date As Date ret_date = InputBox("Enter the Date of Joining", "Date of Joining") If ret_date > Date Then
uGefysLwmvufpJG
164
MsgBox "Invalid Date! Re-enter" Else MsgBox "Date is Valid" End If End Sub
115/
Exit Command Button twGuf Private Sub Command2_Click() Unload Me End End Sub ---------------0-0-0---------------
yHk(182)
116/ aumif;
yH(k 182)yg Form wGif Fans, Music System wdkYudk Menu Editor... jzifhvnf; TextBox, wdkYjzifhvnf;aumif;wnfaqmufxm;NyD; Properties rsm;ud k jyif q if j znf h p G u f N yD ; aemuf Command Button toD ; oD ; wG i f vdktyfaomy½dk*&rfrsm; udk a&;om;&ayrnf/ 117/
General, Declaration wGif Dim LastItem As Integer
118/
Menu Editor Dialog Box wGif (u) Caption &Fans ( c) Name Fans ( *) Caption &Music System (C) Name mnMusic
165
Microsoft Visual Basic 6.0
119/ mnMusic \ Properties udk yH(k 183)ygtwdi k ;f Index tm; 0 (Zero) xm;ay; &rnf/ xdrk o S my½d*k &rf Run í&ayrnf/
yHk(183)
120/
Run Command Button twGuf Private Sub Command1_Click() lastitem = lastitem + 1 If lastitem > 10 Then MsgBox "Limit Exceeded" Else Load mnMusic(lastitem) mnMusic(lastitem).Caption = Text1.Text End If End Sub
121/
Exit Command Button twGuf Private Sub Command2_Click() Unload Me End End Sub
166
uGefysLwmvufpJG 122/
tqdyk g y½d*k &rfukd Run ygu yHk(184)ygtwdkif;jrifawGU&ayrnf/
yHk(184)
---------------0-0-0---------------
yHk(185)
123/ yHk(185)yg Form wGif File, Add, Delete, Exit wdkYudk Menu Editor... jzifhvnf;aumif;? TextBox, wdkYjzifhvnf;aumif;wnfaqmuf xm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGif vdktyfaom y½dk*&rfrsm;udk a&;om;&ayrnf/ 124/ Menu Editor Dialog Box wGif Caption ESifh Name wdjYk znfp h u G &f eftcsuf rsm;tm; Z,m;jzifhazmfjytyfygonfCaption &File &Add &Delete E&xit
Name mnFile mnAdd mnDelete mnExit mnSep
167
Microsoft Visual Basic 6.0
125/ mnSep udk Caption a&;&efrvdy k g/ Name wGio f m mnSep [kowfrSwfí 4if; Properties \ Index wGif 0 (Zero) ay;&ayrnf/ 126/
General, Declaration wGif Dim LastItem As Integer
127/
Form Load wGif Private Sub Form_Load() LastItem = 0 mnDelete.Enabled = False End Sub
128/
Add Menu twGuf Private Sub mnAdd_Click(Index As Integer) LastItem = LastItem + 1 Load mnSep(LastItem) mnSep(LastItem).Caption = "ITEM" + Str(LastItem) mnDelete.Enabled = True End Sub
129/
Delete Menu twGuf Private Sub mnDelete_Click() Unload mnSep(LastItem) LastItem = LastItem - 1 If LastItem = 0 Then mnDelete.Enabled = False End If End Sub
130/
Exit Menu twGuf Private Sub mnExit_Click() Unload Me End End Sub
uGefysLwmvufpJG
168
131/
mnSep Click twGuf Private Sub mnSep_Click(Index As Integer) MsgBox "The selected item is " + Str(Index) End Sub
132/
tqdyk g y½d*k &rfukd Run ygu yHk(186)ygtwdkif;jrifawGU&ayrnf/
yHk(186)
133/ Add Menu udka½G;ygu ITEM rsm;wdk;vmNyD; Delete Menu a½G;ygu ITEM rsm; ysufoGm;onfudkawGU½Sd&ayrnf/ ---------------0-0-0---------------
yHk(187)
134/
yH(k 187)yg Form wGif OptionButton, , wdjYk zifv h nf;aumif;wnfaqmufxm;Ny;D Properties rsm;udjk yifqifjznfph u G f NyD;aemuf Command Button toD;oD;wGif vdt k yfaomy½d*k &rfrsm;udk a&;om;&ayrnf/ CommonDialog Control udk Toolbox twGif;odkYqJGwif&mwGif Toolbox EIwc f rf;om; vGwaf eaomae&mwpfcu k kd Mouse Pointer ñTeí f Right Click ESyd yf g/ yH(k 188)ygtwdik ;f Short Cut Menu wpfckay:vmrnf/
169
Microsoft Visual Basic 6.0
yHk(188)
135/
yHk(188)wGif Components... udkxyfrHa½G;cs,fyg/ xdktcg Components Dialog Box ay:vmrnf/ yHk(189)/ 4if;rS Microsoft Common Dialog Control 6.0 uda k ½G;cs,Nf y;D Apply Command Button udak ½G;cs,yf g/ xdaYk emuf Close Command Button udkxyfrHa½G;cs,f&rnf/
yHk(189)
136/ xdt k cg Toolbox wGif yH(k 190)ygtwdik ;f CommonDialog Control a&muf½dS vmayrnf/
uGefysLwmvufpJG
170
yHk(190)
137/
Option1-Option Properties wGif Index udk 0 (Zero) [kowfrw S &f rnf/
138/
Run Command Button twGuf Private Sub Command1_Click() If Option1(0).Value Then CommonDialog1.ShowOpen ElseIf Option1(1).Value Then CommonDialog1.ShowSave ElseIf Option1(2).Value Then CommonDialog1.ShowColor End If End Sub
139/
Exit Command Button twGuf Private Sub Command2_Click() Unload Me End End Sub
140/
Form xJwGif aemufxyf Option Button jzpfay:vm&eftwGuf Private Sub Form_Paint() Static F As Integer If F <> True Then For i = 1 To 2 Load Option1(i) Option1(i).Top = Option1(i - 1).Top + 350 Option1(i).Visible = True Next i Option1(0).Caption = "Open"
171
Microsoft Visual Basic 6.0
Option1(1).Caption = "Save" Option1(2).Caption = "Color" Command1.Caption = "Show Dlg" F = True End If End Sub
141/
txufyg y½dk*&rfudk Run ygu atmufygtwdkif;jrifawGU&rnf/ yHk(191)/
yHk(191)
---------------0-0-0---------------
yHk(192)
172
uGefysLwmvufpJG 142/
yH(k 192)yg Form wGif File, Points, Line, Clear, Exit wdkYudk Menu Editor...
jzifv h nf;aumif;? vIy½f mS ;&rnft h csed u f mvudk
Timer wdjYk zifv h nf;aumif; wnfaqmuf
xm;NyD;? Timer1 Timer Properties wGif Interval-100 [k jyifqifjznfhpGufNyD;aemuf Pulldown Menu toD;oD;wGif vdktyfaom y½dk*&rfrsm;udk a&;om;&ayrnf/ 143/
Menu Editor... \jyifqifrt I m; Z,m;jzifah zmfjyxm;ygonf/ Caption &File ...&Points ...&Lines ...&Clear ......E&xit
Name mnFile mnPoints mnLines mnClear mnSep mnExit
144/
General, Declaration wGif Dim Points
145/
Form Load twGuf Private Sub Form_Load() Points = 0 End Sub
146/
Clear Pulldown Menu twGuf Private Sub mnClear_Click() Points = 0 Form1.Cls End Sub
147/
Exit Pulldown Menu twGuf Private Sub mnExit_Click() Unload Me End End Sub
173
Microsoft Visual Basic 6.0
148/
Lines Pulldown Menu twGuf Private Sub mnLines_Click() Dim Counter For Counter = 1 To 100 Step 1 Line -(Rnd * Form1.ScaleWidth, Rnd * Form1.ScaleHeight), RGB(0, 0, 0) Next End Sub
149/
Points Pulldown Menu twGuf Private Sub mnPoints_Click() Points = 1 End Sub
150/
Timer1 Timer tcsdefumv twGuf Private Sub Timer1_Timer() Dim R, G, B Dim X, Y Dim Counter If Points = 1 Then For Counter = 1 To 100 Step 1 R = Rnd * 255 G = Rnd * 255 B = Rnd * 255 X = Rnd * Form1.ScaleWidth Y = Rnd * Form1.ScaleHeight Form1.PSet (X, Y), RGB(R, G, B) Next End If End Sub
---------------0-0-0---------------
uGefysLwmvufpJG
174
yHk(193)
151/ yH(k 192)yg Form wGif Command Button wpfckwnf;jzifhomwnfaqmuf xm;NyD;vdktyfaomy½dk*&rfrsm;udk a&;om;&ayrnf/ 152/
Form udk Click vkyfygujzpfay:vm&eftwGuf Private Sub Form_Click() Dim i ScaleHeight = 8 For i = 0 To 5 DrawStyle = i Line (0, i + 1)-(ScaleWidth, i + 1) Next End Sub
153/
Exit Command Button twGuf Private Sub Command1_Click() Unload Me End End Sub
154/ tqdyk g y½d*k &rfukd Run NyD; Form xJudk Mouse Left Click vkyfygu yHk(194) yg twdkif;jrifawGU&rnf/
175
Microsoft Visual Basic 6.0
yHk(194)
---------------0-0-0---------------
yHk(195)
155/ yH(k 195)yg Form wGif Command Button wpfckwnf;jzifhomwnfaqmuf xm;NyD; vdktyfaomy½dk*&rfrsm;udk a&;om;&ayrnf/ 156/
Form udk Click vkyfygujzpfay:vm&eftwGuf Private Sub Form_Click() Dim CX, CY, Radius ScaleMode = 3 CX = ScaleWidth / 2 CY = ScaleHeight / 2 If CX > CY Then Limit = CY Else Limit = CX
uGefysLwmvufpJG
176
For Radius = 0 To Limit Circle (CX, CY), Radius, RGB(Rnd * 255, Rnd * 255, Rnd * 255) Next End Sub
157/
Exit Command Button twGuf Private Sub Command1_Click() Unload Me End End Sub
158/ tqdyk g y½d*k &rfukd Run NyD; Form xJudk Mouse Left Click vkyfygu yHk(196) yg twdkif;jrifawGU&rnf/
yHk(196)
---------------0-0-0---------------
177
Microsoft Visual Basic 6.0
yHk(197)
159/ yH(k 197)yg TextBox, wdjYk zifv h nf;aumif;wnfaqmuf xm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGif vdktyfaomy½dk*&rfrsm;udk a&;om;&ayrnf/ 160/
Text1 TextBox Properties wGif (u) (Name) Text1 ( c) Alignment Left Justify ( *) MultiLine True
161/
Form Click jyKvkyf&eftwGuf Private Sub Form_Click() filenum = FreeFile Open "C:\Setupxlg.txt" For Input As filenum Text1.Text = Input(LOF(filenum), filenum) Close filenum End Sub
162/
Exit Command Button twGuf Private Sub Command1_Click() Unload Me End End Sub
uGefysLwmvufpJG
178
163/ tqdyk gy½d*k &rfukd Run NyD; Form xJukd Mouse Left Click vkyyf gu yH(k 198)yg twdkif;jrifawGU&rnf/
yHk(198)
---------------0-0-0---------------
yHk(199)
163/
yH(k 199)yg Form yHkpHwGif
Label,
TextBox,
Frame,
Combo Box, CheckBox, wdkYjzifhvnf;aumif; wnfaqmuf xm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGif
vdktyfaom y½dk*&rfrsm;udk a&;om;&ayrnf/
179
Microsoft Visual Basic 6.0
164/
Combo1 Combo Properties wGif (u) Text - Fonts ( c) List - Arial, Tahoma, Times, Times New Roman
165/
Combo2 Combo Properties wGif (u) Text - Style ( c) List - Regular, Bold, Italic, Bold Italic
166/
Combo3 Combo Properties wGif (u) Text - Size ( c) List - 8, 10, 12, 14, 16, 18, 20
167/
General, Declaration wGif 'h represents actual height of the form 'f represents actual height of the frame Dim f, h As Integer 'the variable f and h are declared globally
168/
Checkl twGuf Private Sub Check1_Click() 'Executes when check box Underline is checked If (Check1.Value = 1) Then Label2.FontUnderline = True Else Label2.FontUnderline = False End If End Sub
169/
Check2 twGuf Private Sub Check2_Click() 'Executes when check box Strike Through is checked If (Check2.Value = 1) Then Label2.FontStrikethru = True Else Label2.FontStrikethru = False End If End Sub
uGefysLwmvufpJG
180
170/
Combol1 twGuf Private Sub Combo1_LostFocus() 'Executes after you selected font name Label2.FontName = Combo1.Text End Sub
171/
Combol2 twGuf Private Sub Combo2_Change() 'Executes after you selected font style If Combo2.Text = "Italic " Or Combo2.Text = "BoldItalic " Then Label2.FontItalic = True Label2.FontBold = False Else Label2.FontItalic = False Label2.FontBold = True End If End Sub
172/
Combol3 twGuf Private Sub Combo3_Change() 'Executes after you selected font size Label2.FontSize = Val(Combo3.Text) End Sub
173/
Font Command Button twGuf Private Sub Command1_Click() 'Executes when font button is clicked Form1.Height = h 'Initial form height after you click on font button Frame1.Visible = True End Sub
174/
Preview Command Button twGuf Private Sub Command2_Click() 'Executes after you selected Ok button Text1.FontName = Label2.FontName Text1.FontSize = Label2.FontSize If Label2.FontItalic = True Then
181
Microsoft Visual Basic 6.0
Text1.FontBold = False Text1.FontItalic = True Else Text1.FontBold = True Text1.FontItalic = False End If If (Check1.Value = 1) Then Text1.FontUnderline = True Else Text1.FontUnderline = False End If If (Check2.Value = 1) Then Text1.FontStrikethru = True Else Text1.FontStrikethru = False End If End Sub
175/
Exit Command Button twGuf Private Sub Command3_Click() Unload Me End End Sub
176/
Form Load twGuf Private Sub Form_Load() h = Form1.Height f = Frame1.Height Frame1.Visible = False Form1.Height = h - f 'Initial form height before you click on font button End Sub
177/
Text1 Change twGuf Private Sub Text1_Change() Label2.Caption = Text1.Text End Sub ---------------0-0-0---------------
uGefysLwmvufpJG
182
yHk(200)
178/ yH(k 200)yg Form yHkpHwGif Label, TextBox, wdkY jzifw h nfaqmufxm;Ny;D Properties rsm;udjk yifqifjznfph u G Nf y;D aemuf Command Button toD;oD;wGifvdktyfaom y½dk*&rfrsm;udk a&;om;&ayrnf/ 179/
Calculate - Command Button1 twGuf Private Sub Command1_Click() Text4.Text = Val(Text1.Text) - Val(Text2.Text) + Val(Text3.Text) End Sub
180/
Exit - Command Button2 twGuf Private Sub Command2_Click() Unload Me End End Sub ---------------0-0-0---------------
183
Microsoft Visual Basic 6.0
yHk(201)
181/
yH(k 201)yg Form yHkpHwGif
DirListBox,
FileListBox,
Drive
wdkYjzifhwnfaqmufxm;NyD; Properties rsm;udjk yifqifjznfp h u G Nf y;D aemufCommand Button toD;oD;wGiv f t kd yfaom y½dk*&rfrsm;udka&;om;&ayrnf/ ListBox,
Label,
Image,
182/
File1 FileListBox - Properties wGif (u) (Name) File1 ( c) Pattern *.bmp;*.pic;*.jpg;*.gif;*.wmf;*.tif
183/
Label1 Label - Properties wGif (u) (Name) Label1 ( c) AutoSize False ( *) Caption Empty (C) BorderStyle1 - Fixed Single ( i) WordWrap True
uGefysLwmvufpJG 184/
184
Image1 Image - Properties wGif (u) (Name) Image1 ( c) Stretch True
185/
Directory Change twGuf Private Sub Dir1_Change() File1.FileName = Dir1.Path End Sub
186/
File a½G;&eftwGuf Private Sub File1_Click() Image1.Picture = LoadPicture(Dir1.Path & "\" & File1.FileName) Label1.Caption = Dir1.Path & "\" & File1.FileName End Sub
187/
Exit - Command Button twGuf Private Sub Command2_Click() Unload Me End End Sub ---------------0-0-0---------------
185
Microsoft Visual Basic 6.0
yHk(202)
188/
yH(k 202)yg Form yHkpHwGif TextBox, ListBox, Command Button wdkYjzifhwnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGifvdktyfaom y½dk*&rfrsm;udka&;om;&ayrnf/ 189/
General, Declaration wGif Dim i As Integer
190/
Add Command Button twGuf Private Sub command1_Click() List1.AddItem (Text1.Text) End Sub
191/
Delete Command Button twGuf Private Sub Command2_Click() List1.RemoveItem (i) End Sub
192/
Clear Command Button twGuf Private Sub Command3_Click() List1.Clear End Sub
193/
Exit Command Button twGuf Private Sub Command4_Click() Unload Me End End Sub ---------------0-0-0---------------
uGefysLwmvufpJG
186
yHk(203)
194/ yHk(202)yg FormyHkpHwGif , Command Button wdkYjzifh wnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGif vdktyfaomy½dk*&rfrsm;udka&;om;&ayrnf/ 195/
Run Command Button twGuf Private Sub Command1_Click() With Form1.MSChart1 .chartType = VtChChartType3dArea .ColumnCount = 10 .RowCount = 10 For Column = 1 To 10 For Row = 1 To 10 .Column = Column .Row = Row Next Row Next Column End With End Sub
187
Microsoft Visual Basic 6.0
196/
Exit Command Button twGuf Private Sub Command4_Click() Unload Me End End Sub
197/
txufygy½dk*&rfudk Run ygu yHk(204)ygtwdkif;jrifawGU&ayrnf/
yHk(204)
---------------0-0-0---------------
uGefysLwmvufpJG
188
yHk(205)
yHk(206)
189 198/ Label,
Microsoft Visual Basic 6.0
yHk(205)ESifh yHk(206)yg Form yHkpHrsm;wGif TextBox,
CheckBox,
,
,
Command Button wdkYjzifhwnfaqmuf
xm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGif vdktyfaom y½dk*&rfrsm;udk a&;om;&ayrnf/ 199/
Check1 twGuf Private Sub Check1_Click() If Check1.Value = vbChecked Then MSChart1.ShowLegend = True Else MSChart1.ShowLegend = False End If End Sub
200/
Refresh Command Button twGuf Private Sub Command1_Click() MSChart1.Row = 1 MSChart1.Column = 1 MSChart1.Data = Text1.Text MSChart1.Row = 2 MSChart1.Column = 1 MSChart1.Data = Text2.Text MSChart1.Row = 3 MSChart1.Column = 1 MSChart1.Data = Text3.Text MSChart1.Row = 1 MSChart1.Column = 2 MSChart1.Data = Text4.Text MSChart1.Row = 2 MSChart1.Column = 2 MSChart1.Data = Text5.Text MSChart1.Row = 3 MSChart1.Column = 2 MSChart1.Data = Text6.Text MSChart1.Row = 1
uGefysLwmvufpJG
190
MSChart1.Column = 3 MSChart1.Data = Text7.Text MSChart1.Row = 2 MSChart1.Column = 3 MSChart1.Data = Text8.Text MSChart1.Row = 3 MSChart1.Column = 3 MSChart1.Data = Text9.Text End Sub
201/
Exit Command Button twGuf Private Sub Command2_Click() Unload Me End End Sub ---------------0-0-0---------------
191
Microsoft Visual Basic 6.0
yHk(207)
202/ yH(k 207)yg Form yHkpHwGif , Command Button wdkYjzifh wnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGifvdktyfaomy½dk*&rfrsm;udka&;om;&ayrnf/ 203/
204/
MSFlexGrid1 MSFlexGrid Properties twGuf (u) Cols - 13 ( c) Rows - 13
Add Command Button twGuf Private Sub Command1_Click() Form1.Caption = "Addition Program" Dim x, y For x = 1 To 12 Step 1 MSFlexGrid1.Row = x For y = 1 To 12 Step 1 MSFlexGrid1.Col = y MSFlexGrid1.Text = x + y Next Next End Sub
uGefysLwmvufpJG
192
205/
Subtract Command Button twGuf Private Sub Command2_Click() Form1.Caption = "Subtraction Program" Dim x, y For x = 1 To 12 Step 1 MSFlexGrid1.Row = x For y = 1 To 12 Step 1 MSFlexGrid1.Col = y MSFlexGrid1.Text = x - y Next Next End Sub
206/
Division Command Button twGuf Private Sub Command3_Click() Form1.Caption = "Division Program" Dim x, y For x = 1 To 12 Step 1 MSFlexGrid1.Row = x For y = 1 To 12 Step 1 MSFlexGrid1.Col = y MSFlexGrid1.Text = x / y Next Next End Sub
207/
Multiplication Command Button twGuf Private Sub Command4_Click() Form1.Caption = "Multiplication Program" Dim x, y For x = 1 To 12 Step 1 MSFlexGrid1.Row = x For y = 1 To 12 Step 1 MSFlexGrid1.Col = y MSFlexGrid1.Text = x * y
193
Microsoft Visual Basic 6.0
Next Next End Sub
208/
Grid Line Width Command Button twGuf Private Sub Command5_Click() If MSFlexGrid1.GridLineWidth < 4 Then MSFlexGrid1.GridLineWidth = MSFlexGrid1.GridLineWidth + 1 Else MSFlexGrid1.GridLineWidth = 1 End If End Sub
209/
Exit Command Button twGuf Private Sub Command6_Click() Unload Me End End Sub
210/
Form Load twGuf Private Sub Form_Load() Dim a As Integer MSFlexGrid1.Row = 0 For a = 1 To 12 MSFlexGrid1.Col = a MSFlexGrid1.Text = Str(a) Next MSFlexGrid1.Col = 0 For a = 1 To 12 MSFlexGrid1.Row = a MSFlexGrid1.Text = Str(a) Next End Sub
uGefysLwmvufpJG
194
211/ yH(k 207)yg Form yHkpH Program udk Run yguatmufygtwdkif;jrifawGU&rnf/ yH(k 208)/
yHk(208)
212/
Add Command Button udka½G;cs,fygu yHk(209)ygtwdkif;jrifawGU&rnf/
yHk(209)
195 213/
Microsoft Visual Basic 6.0
Subtract Command Button udak ½G;cs,y f gu yH(k 210)ygtwdik ;f jrifawGU&rnf/
yHk(210)
214/
Division Command Button udak ½G;cs,y f gu yH(k 211)ygtwdik ;f jrifawGU&rnf/
yHk(211)
uGefysLwmvufpJG 215/ &rnf/
196
Multiplication Command Button udak ½G;cs,y f gu yH(k 212)ygtwdik ;f jrifawGU
yHk(212)
216/ Grid Line Width Command Button udka½G;cs,fyguyHk(213)ygtwdkif; jrifawGU&rnf/
yHk(213)
---------------0-0-0---------------
197
Microsoft Visual Basic 6.0
yHk(214)
217/ yH(k 214)yg Form yHkpHwGif , Label, Command Button wdYk jzifw h nfaqmufxm;Ny;D Properties rsm;udjk yifqifjznfph u G Nf y;D aemuf Command Button toD;oD;wGif vdktyfaomy½dk*&rfrsm;udk a&;om;&ayrnf/ 218/
Exit Command Button twGuf Private Sub Command1_Click() Unload Me End End Sub
219/
Form Load twGuf Private Sub Form_Load() MSFlexGrid1.Cols = 6 MSFlexGrid1.Rows = 7 End Sub
220/
Grid Line Change &eftwGuf Private Sub MSFlexGrid1_RowColChange() Msg = "Active Cell: " & Chr(64 + MSFlexGrid1.Col) Msg = Msg & MSFlexGrid1.Row Label1.Caption = Msg End Sub
221/
tqdyk g y½d*k &rfukd Run Ny;D rdrt d vd½k &dS m Row (or) Column wdu Yk akd ½G;cs,yf gu Grid Line Cell tuGuf½Sd Cell Reference udk yHk(215)ygtwdkif;azmfjyvdrfhrnf/
uGefysLwmvufpJG
198
yHk(215)
---------------0-0-0---------------
yHk(216)
222/ yH(k 216)yg Form yHkpHwGif , Command Button wdkYjzifh wnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGifvdktyfaom y½dk*&rfrsm;udka&;om;&ayrnf/ 223/
RichTextBox1 - RichTextBox Properties twGuf (u) (Name) RichTextBox1 ( c) Font MS Sans Serif, Bold, 12 ( *) ScrollBars 3 - rtfBoth
224/
RichTextBox2 - RichTextBox Properties twGuf (u) (Name) RichTextBox2 ( c) Font MS Sans Serif, Regular, 8 ( *) ScrollBars 3 - rtfBoth
199
Microsoft Visual Basic 6.0
225/
Add Text Command Button twGuf Private Sub Command1_Click() RichTextBox2.Text = RichTextBox2.Text & RichTextBox1.SelText End Sub
226/
Exit Command Button twGuf Private Sub Command2_Click() Unload Me End End Sub
227/
Form Load twGuf Private Sub Form_Load() RichTextBox1.FileName = "c:\tm.rtf" End Sub
228/
txufyg y½dk*&rfudk Run ygu yHk(217)ygtwdkif;awGUjrif&rnf/
yHk(217)
uGefysLwmvufpJG
200
229/
yH(k 217)yg b,fbufwiG ½f adS eaompmom;tm; Selected Text vkyNf y;D ? yH(k 218)? Add Text Command Button udka½G;cs,fygu yHk(219)ygtwdkif;jzpfay:vmrnf/
yHk(218)
yHk(219)
---------------0-0-0---------------
201
Microsoft Visual Basic 6.0
yHk (220)
230/
yH(k 220)yg Form yHkpHwGif , , Command Button wdkYjzifhwnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGifvdktyfaom y½dk*&rfrsm;udka&;om;&ayrnf/ 231/
Open File Command Button twGuf Private Sub Command1_Click() CommonDialog1.DialogTitle = "Open File" CommonDialog1.Filter = "Text File|*.txt|Rich Text File|*.rtf" CommonDialog1.ShowOpen If CommonDialog1.FilterIndex = 1 Then RichTextBox1.LoadFile CommonDialog1.FileName, rtfText Else RichTextBox1.LoadFile CommonDialog1.FileName, rtfRTF End If Me.Caption = CommonDialog1.FileName End Sub
232/
Save File Command Button twGuf Private Sub Command2_Click() CommonDialog1.Filter = "Text File|*.txt|Rich Text File|*.rtf" CommonDialog1.ShowSave If CommonDialog1.FilterIndex = 1 Then RichTextBox1.SaveFile CommonDialog1.FileName, rtfText Else RichTextBox1.SaveFile CommonDialog1.FileName, rtfRTF End If End Sub
uGefysLwmvufpJG
202
233/
Fonts Command Button twGuf Private Sub Command3_Click() CommonDialog1.Flags = cdlCFEffects + cdlCFBoth CommonDialog1.ShowFont With RichTextBox1 .SelBold = CommonDialog1.FontBold .SelFontName = CommonDialog1.Name .SelFontSize = CommonDialog1.FontSize .SelItalic = CommonDialog1.FontItalic .SelStrikeThru = CommonDialog1.FontStrikethru .SelUnderline = CommonDialog1.FontUnderline .SelColor = CommonDialog1.Color End With End Sub
234/
Exit Command Button twGuf Private Sub Command4_Click() Unload Me End End Sub
235/
Form tus,ftusOf;jyKvkyf&eftwGuf Private Sub Form_Resize() If Me.WindowState = vbMinimized Then Exit Sub RichTextBox1.Height = Me.Height - 1260 RichTextBox1.Width = Me.Width - 285 Command1.Top = Me.Height - 915 Command2.Top = Me.Height - 915 Command3.Top = Me.Height - 915 Command4.Top = Me.Height - 915 End Sub
236/
Form Load twGuf Private Sub Form_Load() Form1.Caption = "Sample 36" End Sub
203 237/
Microsoft Visual Basic 6.0
tqdyk g y½d*k &rfukd Run yguyHk(221)ygtwdkif;jrifawGU&rnf/
yHk(221) 238/ &rnf/
Open File Command Button udka½G;cs,fygu yHk(222)ygtwdkif;jrifawGU
yHk(222)
204
uGefysLwmvufpJG 239/
wpfzufyg Dialog Box wGif Files of type: nmzuf½Sd List Box ü Dropdown Arrow jzpfaom udka½G;cs,fygu Text File ESifh Rich Text Format File trsK;d tpm; (2)ckxr J S BuKu d &f mzdik t f rsK;d tpm;udak ½G;cs,í f Open Command Button udka½G;cs,fygu a½G;cs,fjcif;cH&aom *.txt (or) *.rtf File rsm;yGiv hf mayrnf/ yH(k 223)/
yHk(223)
---------------0-0-0--------------Microsoft Windows Common Controls wGifyg0ifaom Icon rsm;
240/
atmufygZ,m;jzifhazmfjytyfygonfCommon Controls wGifyg0ifaom Icon rsm; TabStrip
Toolbar
StatusBar
ProgressBar
TreeView
ListView
ImageList
Slider
ImageCombo
205
Microsoft Visual Basic 6.0
yHk(224)
241/
yH(k 224)yg Form yHkpHwGif TextBox, Toolbar,, Command Button wdkYjzifh wnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGif vdktyfaomy½dk*&rfrsm;udk a&;om;&ayrnf/ 242/
Text1 - Text Properties twGuf (u) (Name) Text1 ( c) Alignment 0 - Left Justify ( *) BorderStyle1 - Fixed Single (C) Font MS Sans Serif, Regular, 10 ( i) MultiLine True ( p) ScrollBar 3 - Both
243/
Toolbar1 - Toolbar Properties twGuf (u) (Name) Toolbar1 ( c) Alignment 0 - vbAlignNone ( *) BorderStyle1 - ccFixedSingle
244/
Form yHkpHtwGif;½Sd Toolbar udka½G;cs,fí Right Click ESy d yf g/ xdaYk emuf Properties udak ½G;cs,y f gu yH(k 225)ygtwdik ;f Property Pages Dialog Box ay:vmrnf/
206
uGefysLwmvufpJG
yHk(225)
245/
Property Pages Dialog Box xJ½Sd General, Buttons, Picture Tab Command Button (3)ckxJrS Buttons Tab Command Button udka½G;cs,fyg/ xdkYaemuf
4if;xJwGifyg0ifaom tcsuftvufrsm;tm;atmufazmfjyygZ,m;twdkif; jyifqifjznfh pGuf&ef Index 1 2 3
246/
Caption Cut Copy Paste
Key Button1 Button2 Button3
Tag 1 2 3
Toolbar xJ½Sd Button rsm;twGuf Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Key Case "Button2": Clipboard.Clear
207
Microsoft Visual Basic 6.0
Clipboard.SetText Text1.SelText Case "Button1": Clipboard.Clear Clipboard.SetText Text1.SelText Text1.Text = " " Case "Button3": Text1.SelText = Clipboard.GetText() End Select End Sub
247/
Exit Command Button twGuf Private Sub Command1_Click() Unload Me End End Sub
248/ tqdyk gy½d*k &rfukd Run NyD; Text Box xJwiG pf mrsm;½du k Ef ydS í f rdrt d vd½k &dS mpmrsm; udk Selected Text (or) Drag jyKvkyfum ul;jcif;? jzwfjcif;? uyfjcif;wdkYudkaqmif½GufEdkifyg onf/ y½d*k &rfxrJ S xGuv f ykd gu Exit Command Button udka½G;cs,f&efjzpfygonf/ ---------------0-0-0---------------
yHk(226)
249/
yH(k 226)yg Form yHkpHwGif Toolbar, StatusBar,, Command Button wdkYjzifh wnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGif vdktyfaomy½dk*&rfrsm;udk a&;om;&ayrnf/
208
uGefysLwmvufpJG 250/
Toolbar1 - Toolbar Properties twGuf (u) (Name) Toolbar1 ( c) Align 1 - vbAlignTop
251/
Menu Editor Dialog Box wGifatmufygZ,m;twdkif;jyifqifyg&efIndex 1 2 3 4
252/
Caption Subject One Subject Two Subject Three Subject Four
Key Sub1 Sub2 Sub3 Sub4
Tag 1 2 3 4
StatusBar1 - StatusBar Properties twGuf (u) (Name) StatusBar1 ( c) Align 2 - vbAlignBottom
253/
Add Button Command Button twGuf Private Sub Command1_Click() Static i As Integer Dim c As String i=i+1 c = InputBox("Enter Button Title") Toolbar1.Buttons.Add i, , c End Sub Private Sub Command1_GotFocus() StatusBar1.Panels(1).Text = "Click to Add a Button of the Toolbar" End Sub
254/
Delete Button Command Button twGuf Private Sub Command2_Click() Dim i As Integer i = InputBox("Enter Button No. to Delete") Toolbar1.Buttons.Remove i End Sub
209
Microsoft Visual Basic 6.0
Private Sub Command2_GotFocus() StatusBar1.Panels(1).Text = "Click to Delete a Button from the Toolbar" End Sub
255/
Add Panel Command Button twGuf Private Sub Command3_Click() Static i As Integer Dim c As String i=i+1 If StatusBar1.Panels.Count = 16 Then MsgBox "You can add only 16 Panels in a Status Bar" Exit Sub End If c = InputBox("Enter Panel Title") StatusBar1.Panels.Add i, , c StatusBar1.Panels(i).AutoSize = sbrSpring End Sub Private Sub Command3_GotFocus() StatusBar1.Panels(1).Text = "Click to Add a Panel to the Status Bar" End Sub
256/
Delete Panel Command Button twGuf Private Sub Command4_Click() Dim i As Integer i = InputBox("Enter Panel No. to Delete") StatusBar1.Panels.Remove i End Sub Private Sub Command4_GotFocus() StatusBar1.Panels(1).Text="Click to Delete a Panel from the Status Bar" End Sub
257/
Exit Command Button twGuf Private Sub Command5_Click() Unload Me End End Sub
uGefysLwmvufpJG
210
258/
Status Bar Panel Click twGuf Private Sub StatusBar1_PanelClick(ByVal Panel As MSComctlLib.Panel) MsgBox "You have Clicked" & Panel.Text End Sub
259/
Tool Bar Button Click twGuf Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) MsgBox "You have Clicked" & Button.Caption End Sub
260/
txufygy½dk*&rfudk Run NyD; Add Button udka½G;cs,fygu Enter Button Title \ acgif;pOfatmuf List Box wGif rdrt d vd½k &dS mpmom;ud½k u kd Ef ydS Nf y;D OK udak ½G;cs,f yg/ yH(k 227)? yH(k 228)/
yHk(227)
yHk(228)
211
Microsoft Visual Basic 6.0
261/ Delete Button udka½G;cs,fygu Enter Button No. to Delete \acgif;pOf atmuf List Box wGif rdrzd ,f½mS ;vdo k nft h rSwpf Ofu½kd u kd Ef ydS Nf y;D OK udak ½G;cs,yf g/ yH(k 229)? yH(k 230)/
yHk(229)
yHk(230)
262/ Add Panel udka½G;cs,fygu Enter Panel Title \acgif;pOfatmuf List Box wGif rdrdtvdk½Sd&mpmom;udk½dkufESdyfNyD; OK udka½G;cs,fyg/ yHk(231)? yHk(232)/
uGefysLwmvufpJG
212
yHk(231)
yHk(232)
263/ DeletePanel udka½G;cs,fygu Enter Button No. to Delete \acgif;pOf atmuf List Box wGif rdrzd ,f½mS ;vdo k nft h rSwpf Ofu½kd u kd Ef ydS Nf y;D OK udak ½G;cs,yf g/ yH(k 233)? yH(k 234)/
213
Microsoft Visual Basic 6.0
yHk(233)
yHk(234)
---------------0-0-0---------------
uGefysLwmvufpJG
214
yHk(235)
264/ yH(k 235)yg Form yHkpHwGif ProgressBar,, Command Button wdkYjzifh wnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGifvdktyfaomy½dk*&rfrsm;udk a&;om;&ayrnf/ 265/
ProgressBar1 - ProgressBar Properties twGuf (u) (Name) ProgressBar1 ( c) Align 0 - vbAlignNone ( *) BorderStyle1 - ccFixedSingle (C) Max 30000 ( i) Min 1
266/
Run Command Button twGuf Private Sub Command1_Click() Dim n1 As Integer For n1 = 1 To 30000 Form1.Caption = "Processing Step " & Trim$(CStr(n1)) & " of 30000" ProgressBar1 = n1 Next n1 End Sub
267/
Exit Command Button twGuf Private Sub Command2_Click() Unload Me End End Sub ---------------0-0-0---------------
215
Microsoft Visual Basic 6.0
yHk(236)
268/
yHk(235)yg Form yHkpHwGif Slider, TextBox, Command Button wdkYjzifhwnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGifvdktyfaom y½dk*&rfrsm;udka&;om;&ayrnf/ 269/
Form Load twGuf Private Sub Form_Load() Text1.Width = 6000 'Set a minimum width for the TextBox Slider1.Left = Text1.Left 'Align the Slider to the TextBox 'Match the width of the Slider to the TextBox Slider1.Max = Text1.Width 'Place the Slider a little below the TextBox Slider1.Top = Text1.Top + Text1.Height + 50 'Set tickfrequency to a fraction of the Max value Slider1.TickFrequency = Slider1.Max * 0.1 'SetLargeChange and SmallChange value to a fraction of Max Slider1.LargeChange = Slider1.Max * 0.1 Slider1.SmallChange = Slider1.Max * 0.01 End Sub
270/
Slider1 Change twGuf Private Sub Slider1_Change() 'If the slider is under 1/3 the size of the textbox, no change. 'Else, match the width of the textbox to the Slider's value If Slider1.Value > Slider1.Max / 3 Then Text1.Width = Slider1.Value End If End Sub
uGefysLwmvufpJG
216
271/
Exit Command Button twGuf Private Sub Command2_Click() Unload Me End End Sub
272/ tqdkyg y½dk*&rfudk Run yguyHk(237)ygtwdkif;jrifawGU&rnfjzpfNyD; Slider \twd;k ^ tavsmah jymif;Munfyh gu Text Box tus,^f tusO;f jzpfomG ;onfukd jrifawGU& ayrnf/
yHk(237)
---------------0-0-0---------------
yHk(238)
273/
yH(k 238)yg Form yHkpHwGif ImageList, PictureBox, Command Button wdkY jzifh wnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;wGif vdktyfaomy½dk*&rfrsm;udk a&;om;&ayrnf/
217 273/
Microsoft Visual Basic 6.0
Picture1 - PictureBox Properties twGuf (u) (Name) Picture1 ( c) Align None ( *) AutoSize True (C) BorderStyle 1 - Fixed Single
274/
Form yHkpHtwGif;½Sd ImageList udka½G;cs,fí Right Click ESy d yf g/ xdaYk emuf Properties udak ½G;cs,y f gu yH(k 239)ygtwdik ;f Property Pages Dialog Box ay:vmrnf/
yHk(239)
275/
Property Pages Dialog Box xJ ½ S d General, Images, Color Tab Command Button (3)ckxJrS Images Tab Command Button udka½G;cs,fyg/ xdkYaemuf 4if;xJwiG yf g0ifaom Insert Picture... Command Button udak ½G;cs,yf g/ xdt k cg rdrt d vdk ½Sdonfh *.bmp File (odkYr[kwf) *.ico File ½Sdonfh vrf;aMumif;rsm;udk½SmazGa½G;cs,fí
zdik rf sm;tm; qJw G if&rnf/ yH(k 240)/
uGefysLwmvufpJG
218
yHk(240)
276/
yHk(240)wGif Open udka½G;cs,fyguyHk(239)wGifazmfjyxm;onfhtwdkif; Club. bmp File a&mufoGm;vdrfhrnf/ txufyg y½dk*&rfudk Run ygu rdrt d vd½k o dS nfh Image qJw G ifvykd gu &½Srd nfjzpfygonf/ yH(k 241)/
yHk(241)
---------------0-0-0---------------
219
Microsoft Visual Basic 6.0
yHk(242)
277/
yH(k 242)yg Form yHkpHwGif TabStrip, TextBox, Command Button wdkYjzifh wnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button ESifh Tab toD;oD;twGufvdktyfaom y½dk*&rfrsm;udka&;om;&ayrnf/ 278/
Form yHkpHtwGif;½Sd TabStrip udka½G;cs,fí Right Click ESy d yf g/ xdaYk emuf Properties udak ½G;cs,y f gu yH(k 243)ygtwdik ;f Property Pages Dialog Box ay:vmrnf/
yHk(243)
220
uGefysLwmvufpJG 279/
Property Pages Dialog Box xJ ½ S d General, Tabs, Font, Picture Command Button (4)ckxJrS Tabs Tab Command Button udka½G;cs,fyg/ xdkYaemuf
4if;xJwGif yg0ifaomtcsuftvufrsm;udk atmufygZ,m;twdkif;jznfhpGuf&ef Index 1 2 3
Caption Department Items Branches
Tag One Two Three
280/
Tab Command Button rsm; Click vkyf&eftwGuf Private Sub TabStrip1_Click() If TabStrip1.SelectedItem.Tag = "One" Then Text1.Text = "Sales Department" Text2.Text = "Purchase Department" Text3.Text = "Admin Department" ElseIf TabStrip1.SelectedItem.Tag = "Two" Then Text1.Text = "Keyboard" Text2.Text = "Monitor" Text3.Text = "Hard Disk" ElseIf TabStrip1.SelectedItem.Tag = "Three" Then Text1.Text = "London" Text2.Text = "New York" Text3.Text = "Singapore" End If End Sub
281/
Exit Command Button twGuf Private Sub Command1_Click() Unload Me End End Sub
282/
tqdyk g y½d*k &rfukd Run yguyHk(244)ygtwdkif;jrifawGU&rnf/
221
Microsoft Visual Basic 6.0
yHk(244)
283/ yH(k 244)wGif Tab Command Button wpfcjk zpfaom Department udak ½G;cs,f ygu yH(k 245)ygtwdik ;f Department ESifhqdkifaomXmersm;udk azmfjyrnfjzpfonf/
yHk(245)
284/ yHk(245)wGif Tab Command Button wpfckjzpfaom Items udka½G;cs,fygu yHk(246) ygtwdkif; Item ESifhqdkifaomudpö&yfrsm;udk azmfjyrnfjzpfonf/
uGefysLwmvufpJG
222
yHk(246)
285/ yHk(246)wGif Tab Command Button wpfckjzpfaom Branches udka½G;cs,fyg u yHk(247)ygtwdkif; Branches ESifhqdkifaomudpö&yfrsm;udk azmfjyrnfjzpfonf/
yHk(247)
286/ þy½dk*&rfxJrS xGufvdkygu Command Button wpfckjzpfaom Exit udk a½G;cs,f&efjzpf ygonf/ ---------------0-0-0---------------
223
Microsoft Visual Basic 6.0
Microsoft Calendar Control (Form twGif;jyu©'defxnfhjcif;) 287/ yH(k 248)yg Form yHkpHwGif Calendar, Command Button wdkYjzifh wnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button
twGufvdktyfaom y½dk*&rfrsm;udka&;om;&ayrnf/
yHk(248)
288/
Exit Command Button twGuf Private Sub Command1_Click() Unload Me End End Sub
289/ tqdyk g y½d*k &rfukd Run ygu ,aeYwiG ½f adS ernfh &uf? v? ckEpS f jyu©'ed u f akd zmfjy rnfjzpfonf/ ---------------0-0-0---------------
uGefysLwmvufpJG
224
Execute File udk y½dk*&rfjzifhvSrf;ac:toHk;jyKjcif;
290/ yHk(249)yg Form yHkpHwGif OLE, Command Button wdkYjzifh wnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button toD;oD;twGuf vdktyfaom y½dk*&rfrsm;udka&;om;&ayrnf/
yHk(249)
291/
Call Indirect Command Button twGuf Private Sub Command1_Click() OLE1.CreateLink "c:\pm65\pm65.exe" End Sub
291/
Call Direct Command Button twGuf Private Sub Command2_Click() Call Shell("c:\pm65\pm65.exe c:\vb6\vb601.p65", 1) End Sub
292/
Exit Command Button twGuf Private Sub Command3_Click() Unload Me End End Sub
293/
tqdyk gy½d*k &rfukd Run ygu yHk(250)ygtwdkif;jrifawGU&rnf/
225
Microsoft Visual Basic 6.0
yHk(250)
294/ txufygyHk(250)wGif Call Indirect Command Button Sub udak ½G;cs,yf gu yHk(251)ygtwdkif;azmfjyrnf/
yHk(251)
295/
yHk(251)wGif OLE Box xJodkYa&mufaeaom Page Maker 6.5 Icon tm; Double Click ESdyfjcif;jzifh Page Maker 6.5 Application Package Run vmayrnf/ Call Direct Command Button udka½G;cs,fjcif;jzifh Page Maker 6.5 Application Package Run vmrnfhtjyif c:\vb6\vb601.p65 zdi k yf gwdu k ½f u kd yf iG v hf mNy;D tvd½k &dS mjyKvyk f Edik af yrnf/ 4if;y½d*k &rfrx S u G v f ykd gu Exit Command Button tm;a½G;cs,&f efjzpfonf/ ---------------0-0-0---------------
uGefysLwmvufpJG
226
jr§m;rsm;udkywfjcmvnfvSnfhonfhy½dk*&rfudka&;jcif; 296/ yHk(248)yg Form yHkpHwGif Image, Command Button wdkYjzifh wnfaqmufxm;NyD; Properties rsm;udkjyifqifjznfhpGufNyD;aemuf Command Button rsm;twGufvdktyfaom y½dk*&rfrsm;udka&;om;&ayrnf/
yHk(252)
297/
Form1 - Form Properties wGif WindowState - 2 - Maximized
298/
General wGif Private Sub rotate() For t = 0 To 100 Next End Sub
299/
Run Command Button twGuf Private Sub Command1_Click() For k = 1 To 10 'Call Shell("c:\windows\mplayer.exe c:\MyDocu~1\Romance.wav",1) Image1.Left = 0 Image1.Top = 0 Image1.Visible = True Image2.Visible = False Image3.Visible = False
227
Microsoft Visual Basic 6.0
Image4.Visible = False i = Image1.Left j = Image1.Top For i = 0 To 11500 Step 1 rotate Image1.Move Image1.Left + 1, Image1.Top Next i Image1.Left = 0 Image1.Top = 0 '''''''''''''' Image2.Left = 11500 Image2.Top = 0 Image1.Visible = False Image2.Visible = True Image3.Visible = False Image4.Visible = False For j = 0 To 8300 Step 1 rotate Image2.Move Image2.Left, Image2.Top + 1 Next j Image2.Left = 11500 Image2.Top = 0 '''''''''''''' Image3.Left = 11500 Image3.Top = 8300 Image1.Visible = False Image2.Visible = False Image3.Visible = True Image4.Visible = False For j = 11500 To 0 Step -1 rotate Image3.Move Image3.Left - 1, Image3.Top Next j Image3.Left = 11500 Image3.Top = 8300
uGefysLwmvufpJG
228
'''''''''''''' Image4.Left = 0 Image4.Top = 8300 Image1.Visible = False Image2.Visible = False Image3.Visible = False Image4.Visible = True For j = 8300 To 0 Step -1 rotate Image4.Move Image4.Left, Image4.Top - 1 Next j Image4.Left = 0 Image4.Top = 8300 Print: Print: Print " ", k: Beep Next k Image1.Left = 0 Image1.Top = 0 Image1.Visible = True Image2.Visible = False Image3.Visible = False Image4.Visible = False End Sub
300/
Exit Command Button twGuf Private Sub Command2_Click() Unload Me End End Sub
301/ tqdyk g y½d*k &rfukd Run ygu jrm§ ;wpfpif;onf vufsm&pf(10)Burd yf wfaeonf udk jrifawGU&vdrfhrnf/ ---------------0-0-0---------------
229
Microsoft Visual Basic 6.0
Chapter (9) Access 2002 ½Sd Database File xJrS Table File wpfcktm;zGifhjcif; 1/ atmufyg Form yHpk (H 2)cktm; zefw;D wnfaqmufxm;&rnf/ yH(k 253)? yH(k 254)/
yHk(253)
yHk(254)
2/
yH(k 253)yg Form yHkpHwGif rsm;jzifzh efw;D xm;Ny;D Command Button rsm;wGif vdktyfaomy½dk*&rfrsm;a&;om;&ef jzpfygonf/ 3/
Open File Command Button twGufPrivate Sub Command1_Click() Form1.Hide Form2.Show End Sub
uGefysLwmvufpJG
230
4/
Exit Command Button twGufPrivate Sub Command2_Click() Unload Me End End Sub
5/
xdkYaemuf Form2 yHkpHtm;zefwD;wnfaqmufxm;&rnf/ yHk(254)/ 4if;wGif , , , , rsm;jzifhzefwD; xm;NyD; oufqdkif&m Properties rsm;wGifjyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif vdktyfaomy½dk*&rfrsm;a&;om;&ef jzpfygonf/ 6/
Label1, 2, 3, 4, 5, 6, 7, 8 wGifyg0ifMuaom Properties rsm;twGuf (u) Alignment 0 - Left Justify ( c) AutoSize True ( *) BackStyle 0 - Transparent (C) BorderStyle 0 - None ( i) Font MS Sans Serif, Bold, 8
7/
Text1 - TextBox Properties twGuf (u) (Name) Text1 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Roll Number ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
8/
Text2 - TextBox Properties twGuf (u) (Name) Text2 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Name ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
231
Microsoft Visual Basic 6.0
9/
Text3 - TextBox Properties twGuf (u) (Name) Text3 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Myanmar ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
10/
Text4 - TextBox Properties twGuf (u) (Name) Text4 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField English ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
11/
Text5 - TextBox Properties twGuf (u) (Name) Text5 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Maths ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
12/
Text6 - TextBox Properties twGuf (u) (Name) Text6 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Total ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
uGefysLwmvufpJG
232
13/
Text7 - TextBox Properties twGuf (u) (Name) Text7 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Result ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
14/
Text8 - TextBox Properties twGuf (u) (Name) Text8 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Amount of Fail ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
15/
Adodc1 - Adodc Properties twGuf (u) (Name) Adodc1 ( c) Align 0 - vbAlignNone ( *) BOFAction 0 - adDoMoveFirst (C) ConnectingString provider=msdasql;dsn= exam01; uid=;pwd=; ( i) EOFAction 0 - adDoMoveLast ( p) Font MS Sans Serif, Bold, 8 (q) RecordSource select [Roll Number], Name, Myanmar, English, Maths,Total, Result,[Amount of Fail] from exam01 order by [Roll Number]
16/
DataGrid1 - DataGrid Properties twGuf (u) (Name) DataGrid1 ( c) Align 0 - vbAlignNone ( *) AllowAddNew True (C) AllowArrows True ( i) AllowDelete True
233 ( p) AllowUpdate (q) DataSource ( Z) Font
-
Microsoft Visual Basic 6.0 True Adodc1 MS Sans Serif, Bold, 8
17/
Form rSxGufoGm;aomtcg Mouse Pointer yHkrSefjyefjzpf&eftwGuf Private Sub Form_Unload(Cancel As Integer) Screen.MousePointer = vbDefault End Sub
18/
Record Position od&eftwGuf Private Sub Adodc1_MoveComplete(ByVal adReason As ADODB.Event ReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) Adodc1.Caption = "Record: " & CStr(Adodc1.Recordset. AbsolutePosition) End Sub
19/
Add Command Button twGuf Private Sub Command1_Click() Adodc1.Recordset.AddNew End Sub
20/
Update Command Button twGuf Private Sub Command2_Click() Adodc1.Recordset.UpdateBatch adAffectAll End Sub
21/
Delete Command Button twGuf Private Sub Command3_Click() With Adodc1.Recordset .Delete .MoveNext If .EOF Then .MoveLast End With End Sub
uGefysLwmvufpJG
234
22/
Refresh Command Button twGuf Private Sub Command4_Click() Adodc1.Refresh End Sub
23/
Close Command Button twGuf Private Sub Command5_Click() Form2.Hide Form1.Show End Sub
24/
tqdyk g y½d*k &rfukd Run ygu yHk(255)ygtwdkif;jrifawGU&rnfjzpfonf/
yHk(255)
---------------0-0-0---------------
235
Microsoft Visual Basic 6.0
Access 2002 ½Sd Database File wpfcx k rJ S Table File ESpcf t k m; Updating jyKvyk jf cif; 25/ atmufyg Form yHpk (H 3)cktm; zefw;D wnfaqmufxm;&rnf/ yH(k 256)? yH(k 257)?
yH(k 258)/
yHk(256)
yHk(257)
uGefysLwmvufpJG
236
yHk(258)
26/
yH(k 256)yg Form yHkpHwGif rsm;jzifzh efw;D xm;Ny;D Command Button rsm;wGif vdktyfaomy½dk*&rfrsm;a&;om;&ef jzpfygonf/ 27/
(9)wef;(u)zdkif Command Button twGuf-
Private Sub Command1_Click() Form1.Hide Form2.Show End Sub
28/
(9)wef;(c)zdkif Command Button twGuf-
Private Sub Command1_Click() Form1.Hide Form3.Show End Sub
29/
Exit Command Button twGufPrivate Sub Command2_Click() Unload Me End End Sub
30/ xdkYaemuf Form2, Form3 yHkpHtm;zefwD;wnfaqmufxm;&rnf/ yHk(257)? yHk(258)/ 4if;wGif , , , ,
237
Microsoft Visual Basic 6.0
rsm;jzifh zefwD;xm;NyD; oufqdkif&m Properties rsm;wGifjyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif vdktyfaomy½dk*&rfrsm;a&;om;&ef jzpfygonf/ 31/
Label1, 2, 3, 4, 5, 6, 7, 8 wGifyg0ifMuaom Properties rsm;twGuf (u) Alignment 0 - Left Justify ( c) AutoSize True ( *) BackStyle 0 - Transparent (C) BorderStyle 0 - None ( i) Font MS Sans Serif, Bold, 8
32/
Text1 - TextBox Properties twGuf (u) (Name) Text1 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Roll Number ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
33/
Text2 - TextBox Properties twGuf (u) (Name) Text2 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Name ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
34/
Text3 - TextBox Properties twGuf (u) (Name) Text3 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Myanmar ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
uGefysLwmvufpJG
238
35/
Text4 - TextBox Properties twGuf (u) (Name) Text4 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField English ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
36/
Text5 - TextBox Properties twGuf (u) (Name) Text5 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Maths ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
37/
Text6 - TextBox Properties twGuf (u) (Name) Text6 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Total ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
38/
Text7 - TextBox Properties twGuf (u) (Name) Text7 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Result ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
239
Microsoft Visual Basic 6.0
39/
Text8 - TextBox Properties twGuf (u) (Name) Text8 ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Amount of Fail ( i) DataFormat General ( p) DataSource Adodc1 (q) Font MS Sans Serif, Bold, 8
40/
Adodc1 - Adodc Properties twGuf (u) (Name) Adodc1 ( c) Align 0 - vbAlignNone ( *) BOFAction 0 - adDoMoveFirst (C) ConnectingString provider=msdasql;dsn=exam01; uid=;pwd=; ( i) EOFAction 0 - adDoMoveLast ( p) Font MS Sans Serif, Bold, 8 (q) RecordSource select [Roll Number], Name, Myanmar, English, Maths,Total, Result,[Amount of Fail] from exam01 order by [Roll Number] [Form2 twGuf] ( Z) RecordSource select [Roll Number], Name, Myanmar, English, Maths,Total, Result,[Amount of Fail] from exam02 order by [Roll Number] [Form3 twGuf]
41/
DataGrid1 - DataGrid Properties twGuf (u) (Name) DataGrid1 ( c) Align 0 - vbAlignNone ( *) AllowAddNew True (C) AllowArrows True ( i) AllowDelete True ( p) AllowUpdate True (q) DataSource Adodc1 ( Z) Font MS Sans Serif, Bold, 8
uGefysLwmvufpJG
240
42/
Form rSxGufoGm;aomtcg Mouse Pointer yHkrSefjyefjzpf&eftwGuf Private Sub Form_Unload(Cancel As Integer) Screen.MousePointer = vbDefault End Sub
43/
Record Position od&eftwGuf Private Sub Adodc1_MoveComplete(ByVal adReason As ADODB.Event ReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) Adodc1.Caption = "Record: " & CStr(Adodc1.Recordset. AbsolutePosition) End Sub
44/
(3)bmomaygif;jcif; Command Button twGuf -
Private Sub Command1_Click() Adodc1.Recordset.MoveFirst Do While Adodc1.Recordset.EOF = False Adodc1.Recordset("Total") = Adodc1.Recordset("Myanmar") + Adodc1.Recordset("English") + Adodc1.Recordset("Maths") If Adodc1.Recordset("Myanmar") < 40 Or Adodc1.Recordset ("English") < 40 Or Adodc1.Recordset("Maths") < 40 Then Adodc1.Recordset("Result") = "Fail" Else Adodc1.Recordset("Result") = "Pass" End If If Adodc1.Recordset("Myanmar") < 40 And Adodc1.Recordset ("English") < 40 And Adodc1.Recordset("Maths") < 40 Then Adodc1.Recordset("Amount of Fail") = "3" ElseIf Adodc1.Recordset("Myanmar") < 40 And Adodc1.Recordset ("English") < 40 And Adodc1.Recordset("Maths") >= 40 Then Adodc1.Recordset("Amount of Fail") = "2" ElseIf Adodc1.Recordset("Myanmar") < 40 And Adodc1.Recordset ("English") >= 40 And Adodc1.Recordset("Maths") < 40 Then Adodc1.Recordset("Amount of Fail") = "2"
241
Microsoft Visual Basic 6.0
ElseIf Adodc1.Recordset("Myanmar") >= 40 And Adodc1.Recordset ("English") < 40 And Adodc1.Recordset("Maths") < 40 Then Adodc1.Recordset("Amount of Fail") = "2" ElseIf Adodc1.Recordset("Myanmar") < 40 And Adodc1.Recordset ("English") >= 40 And Adodc1.Recordset("Maths") >= 40 Then Adodc1.Recordset("Amount of Fail") = "1" ElseIf Adodc1.Recordset("Myanmar") >= 40 And Adodc1.Recordset ("English") < 40 And Adodc1.Recordset("Maths") >= 40 Then Adodc1.Recordset("Amount of Fail") = "1" ElseIf Adodc1.Recordset("Myanmar") >= 40 And Adodc1.Recordset ("English") >= 40 And Adodc1.Recordset("Maths") < 40 Then Adodc1.Recordset("Amount of Fail") = "1" Else Adodc1.Recordset("Amount of Fail") = Null End If Adodc1.Recordset.Update Adodc1.Recordset.MoveNext Loop Adodc1.Recordset.MoveFirst End Sub
45/
rlvae&modkYjyefoGm;jcif; Command Button twGuf - [Form2 twGuf]
Private Sub Command2_Click() Form2.Hide Form1.Show End Sub
46/
rlvae&modkYjyefoGm;jcif; Command Button twGuf - [Form3 twGuf]
Private Sub Command2_Click() Form3.Hide Form1.Show End Sub ---------------0-0-0---------------
uGefysLwmvufpJG
242
Access 2002 ½Sd Database File wpfcx k rJ S Table File rsm;tm; Form wpfcjk zifzh iG jhf cif; 47/ atmufyg Form yHkpHtm; zefwD;wnfaqmufxm;&rnf/ yHk(259)/
yHk(259) 48/ yH(k 259)yg Form yHpk w H iG f , , rsm;jzifh zefwD;xm;NyD; oufqdkif&m Properties rsm;wGifjyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif vdktyfaomy½dk*&rfrsm;a&;om;&ef jzpfygonf/ 49/
a1 - Adodc Properties twGuf (u) (Name) a1 ( c) Align 0 - vbAlignNone ( *) BOFAction 0 - adDoMoveFirst (C) ConnectingString provider=msdasql;dsn=exam01; uid=;pwd=; ( i) EOFAction 0 - adDoMoveLast ( p) Font MS Sans Serif, Bold, 8 (q) RecordSource select [Roll Number], Name, Myanmar, English, Maths,Total, Result,[Amount of Fail] from exam01 order by [Roll Number]
50/
a2 - Adodc Properties twGuf (u) (Name) a2 ( c) Align 0 - vbAlignNone ( *) BOFAction 0 - adDoMoveFirst (C) ConnectingString provider=msdasql;dsn=exam01; uid=;pwd=;
243 ( i) EOFAction ( p) Font (q) RecordSource
-
Microsoft Visual Basic 6.0 0 - adDoMoveLast MS Sans Serif, Bold, 8 select [Roll Number], Name, Myanmar, English, Maths,Total, Result,[Amount of Fail] from exam02 order by [Roll Number]
51/
a3 - Adodc Properties twGuf (u) (Name) a3 ( c) Align 0 - vbAlignNone ( *) BOFAction 0 - adDoMoveFirst (C) ConnectingString provider=msdasql;dsn=exam01; uid=;pwd=; ( i) EOFAction 0 - adDoMoveLast ( p) Font MS Sans Serif, Bold, 8 (q) RecordSource select [Roll Number], Name, Myanmar, English, Maths,Total, Result,[Amount of Fail] from exam03 order by [Roll Number]
52/
DataGrid1 - DataGrid Properties twGuf (u) (Name) DataGrid1 ( c) Align 0 - vbAlignNone ( *) AllowAddNew True (C) AllowArrows True ( i) AllowDelete True ( p) AllowUpdate True (q) Font MS Sans Serif, Bold, 8
53/
A1 - Adodc \ Record Position twGuf Private Sub a1_MoveComplete(ByVal adReason As ADODB.EventReason Enum, ByVal pError As ADODB.Error, adStatus As ADODB.Event StatusEnum, ByVal pRecordset As ADODB.Recordset) a1.Caption = "Record: " & CStr(a1.Recordset.AbsolutePosition) End Sub
uGefysLwmvufpJG
244
54/
A2 - Adodc \ Record Position twGuf Private Sub a2_MoveComplete(ByVal adReason As ADODB.EventReason Enum, ByVal pError As ADODB.Error, adStatus As ADODB. EventStatusEnum, ByVal pRecordset As ADODB.Recordset) a2.Caption = "Record: " & CStr(a2.Recordset.AbsolutePosition) End Sub
55/
A3 - Adodc \ Record Position twGuf Private Sub a3_MoveComplete(ByVal adReason As ADODB.EventReason Enum, ByVal pError As ADODB.Error, adStatus As ADODB. EventStatusEnum, ByVal pRecordset As ADODB.Recordset) a3.Caption = "Record: " & CStr(a3.Recordset.AbsolutePosition) End Sub
56/
File One Command Button twGuf Private Sub Command1_Click() Set DataGrid1.DataSource = a1 a1.Left = 2880 a1.Top = 4440 a2.Left = 2640 a2.Top = 5760 a3.Left = 5160 a3.Top = 5760 Form1.Height = 5985 Form1.Caption = "Standard 9th, Section (A)" End Sub
57/
File Two Command Button twGuf Private Sub Command2_Click() Set DataGrid1.DataSource = a2 a1.Left = 120 a1.Top = 5760 a2.Left = 2880 a2.Top = 4440 a3.Left = 5160 a3.Top = 5760
245
Microsoft Visual Basic 6.0
Form1.Height = 5985 Form1.Caption = "Standard 9th, Section (B)" End Sub
58/
File Three Command Button twGuf Private Sub Command3_Click() Set DataGrid1.DataSource = a3 a1.Left = 120 a1.Top = 5760 a2.Left = 2640 a2.Top = 5760 a3.Left = 2880 a3.Top = 4440 Form1.Height = 5985 Form1.Caption = "Standard 9th, Section (C)" End Sub
59/
Exit Command Button twGuf Private Sub Command4_Click() Unload Me End End Sub
60/
Form Load twGuf Private Sub Form_Load() Form1.Height = 6975 End Sub ---------------0-0-0---------------
uGefysLwmvufpJG
246
Access 2002 ½Sd Database File trsm;pkxr J S Table File trsm;pktm; Form wpfcjk zifh
zGifhjcif; 61/
atmufyg Form yHkpHtm; zefwD;wnfaqmufxm;&rnf/ yHk(260)/
yHk(260) 62/ yH(k 260)yg Form yHpk w H iG f , , rsm;jzifh zefwD;xm;NyD; oufqdkif&m Properties rsm;wGifjyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif vdktyfaomy½dk*&rfrsm; a&;om;&efjzpfygonf/ 63/
a1 - Adodc Properties twGuf (u) (Name) a1 ( c) Align 0 - vbAlignNone ( *) BOFAction 0 - adDoMoveFirst (C) ConnectingString provider=msdasql;dsn=Test1; uid=;pwd=; ( i) EOFAction 0 - adDoMoveLast ( p) Font MS Sans Serif, Bold, 8 (q) RecordSource select [Identification Number], Rank,Name, Department from Test1 order by [Identification Number]
64/
a2 - Adodc Properties twGuf (u) (Name) a2 ( c) Align 0 - vbAlignNone ( *) BOFAction 0 - adDoMoveFirst (C) ConnectingString provider=msdasql;dsn=exam02; uid=;pwd=;
247 ( i) EOFAction ( p) Font (q) RecordSource
-
Microsoft Visual Basic 6.0 0 - adDoMoveLast MS Sans Serif, Bold, 8 select [Roll Number], Name, Myanmar, English, Maths,Total, Result,[Amount of Fail] from exam02 order by [Roll Number]
65/
a3 - Adodc Properties twGuf (u) (Name) a3 ( c) Align 0 - vbAlignNone ( *) BOFAction 0 - adDoMoveFirst (C) ConnectingString provider=msdasql;dsn=exam01; uid=;pwd=; ( i) EOFAction 0 - adDoMoveLast ( p) Font MS Sans Serif, Bold, 8 (q) RecordSource select [Roll Number], Name, Myanmar, English, Maths,Total, Result,[Amount of Fail] from exam03 order by [Roll Number]
66/
DataGrid1 - DataGrid Properties twGuf (u) (Name) DataGrid1 ( c) Align 0 - vbAlignNone ( *) AllowAddNew True (C) AllowArrows True ( i) AllowDelete True ( p) AllowUpdate True (q) Font MS Sans Serif, Bold, 8
67/
A1 - Adodc \ Record Position twGuf Private Sub a1_MoveComplete(ByVal adReason As ADODB.EventReason Enum, ByVal pError As ADODB.Error, adStatus As ADODB.Event StatusEnum, ByVal pRecordset As ADODB.Recordset) a1.Caption = "Record: " & CStr(a1.Recordset.AbsolutePosition) End Sub
uGefysLwmvufpJG
248
68/
A2 - Adodc \ Record Position twGuf Private Sub a2_MoveComplete(ByVal adReason As ADODB.EventReason Enum, ByVal pError As ADODB.Error, adStatus As ADODB. EventStatusEnum, ByVal pRecordset As ADODB.Recordset) a2.Caption = "Record: " & CStr(a2.Recordset.AbsolutePosition) End Sub
69/
A3 - Adodc \ Record Position twGuf Private Sub a3_MoveComplete(ByVal adReason As ADODB.EventReason Enum, ByVal pError As ADODB.Error, adStatus As ADODB.Event StatusEnum, ByVal pRecordset As ADODB.Recordset) a3.Caption = "Record: " & CStr(a3.Recordset.AbsolutePosition) End Sub
70/
File One Command Button twGuf Private Sub Command1_Click() Set DataGrid1.DataSource = a1 a1.Left = 2880 a1.Top = 4440 a2.Left = 2640 a2.Top = 5760 a3.Left = 5160 a3.Top = 5760 Form1.Height = 5985 Form1.Caption = "Economic File (Table File) from Test1.mdb" End Sub
71/
File Two Command Button twGuf Private Sub Command2_Click() Set DataGrid1.DataSource = a2 a1.Left = 120 a1.Top = 5760 a2.Left = 2880 a2.Top = 4440 a3.Left = 5160 a3.Top = 5760
249
Microsoft Visual Basic 6.0
Form1.Height = 5985 Form1.Caption = "Standard 9th, Section (B) (Table File) from exam02.mdb" End Sub
72/
File Three Command Button twGuf Private Sub Command3_Click() Set DataGrid1.DataSource = a3 a1.Left = 120 a1.Top = 5760 a2.Left = 2640 a2.Top = 5760 a3.Left = 2880 a3.Top = 4440 Form1.Height = 5985 Form1.Caption = "Standard 9th, Section (C) (Table File) from exam01.mdb" End Sub
73/
Exit Command Button twGuf Private Sub Command4_Click() Unload Me End End Sub
74/
Form Load twGuf Private Sub Form_Load() Form1.Height = 6975 End Sub
75/
tqdyk g y½d*k &rfukd Run ygu yHk(261)? (262)? (263)ygtwdkif;jrifawGU&rnf/
uGefysLwmvufpJG
250
yHk(261)
yHk(262)
251
Microsoft Visual Basic 6.0
yHk(263)
---------------0-0-0---------------
uGefysLwmvufpJG
252
Access 2002 ½Sd Database File twGif;rS Table File rsm;tm; Form wpfckjzifh Append jyKvkyfjcif; 76/ atmufyg Form yHkpHtm; zefwD;wnfaqmufxm;&rnf/ yHk(264)/
yHk(264)
77/ yH(k 264)yg Form yHpk w H iG f , , rsm;jzifh zefwD;xm;NyD; oufqdkif&m Properties rsm;wGif jyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif vdktyfaomy½dk*&rfrsm;a&;om;&ef jzpfygonf/ 78/
a1 - Adodc Properties twGuf (u) (Name) a1 ( c) Align 0 - vbAlignNone ( *) BOFAction 0 - adDoMoveFirst (C) ConnectingString provider=msdasql;dsn=exam01; uid=;pwd=; ( i) EOFAction 0 - adDoMoveLast ( p) Font MS Sans Serif, Bold, 8 (q) RecordSource select [Identification Number], Rank,Name, Department from Test1 order by [Identification Number]
79/
a2 - Adodc Properties twGuf (u) (Name) a2 ( c) Align 0 - vbAlignNone ( *) BOFAction 0 - adDoMoveFirst (C) ConnectingString provider=msdasql;dsn=exam02; uid=;pwd=;
253 ( i) EOFAction ( p) Font (q) RecordSource
-
Microsoft Visual Basic 6.0 0 - adDoMoveLast MS Sans Serif, Bold, 8 select [Roll Number], Name, Myanmar, English, Maths,Total, Result,[Amount of Fail] from Test1 order by [Roll Number]
80/
DataGrid1 - DataGrid Properties twGuf (u) (Name) DataGrid1 ( c) Align 0 - vbAlignNone ( *) AllowAddNew False (C) AllowArrows False ( i) AllowDelete False ( p) AllowUpdate False (q) Font MS Sans Serif, Bold, 8 ( Z) DataSource a1
81/
DataGrid2 - DataGrid Properties twGuf (u) (Name) DataGrid2 ( c) Align 0 - vbAlignNone ( *) AllowAddNew True (C) AllowArrows True ( i) AllowDelete True ( p) AllowUpdate True (q) Font MS Sans Serif, Bold, 8 ( Z) DataSource a2
82/
A1 - Adodc \ Record Position twGuf Private Sub a1_MoveComplete(ByVal adReason As ADODB.EventReason Enum, ByVal pError As ADODB.Error, adStatus As ADODB.Event StatusEnum, ByVal pRecordset As ADODB.Recordset) a1.Caption = "Record: " & CStr(a1.Recordset.AbsolutePosition) End Sub
uGefysLwmvufpJG
254
83/
A2 - Adodc \ Record Position twGuf Private Sub a2_MoveComplete(ByVal adReason As ADODB.EventReason Enum, ByVal pError As ADODB.Error, adStatus As ADODB. EventStatusEnum, ByVal pRecordset As ADODB.Recordset) a2.Caption = "Record: " & CStr(a2.Recordset.AbsolutePosition) End Sub
84/
To Append Table File Button twGuf Private Sub Command1_Click() Set DataGrid1.DataSource = a1 a1.Recordset.MoveFirst Do While a1.Recordset.EOF = False a2.Recordset.AddNew z01 = a1.Recordset("Identification Number") z02 = a1.Recordset("Rank") z03 = a1.Recordset("Name") z04 = a1.Recordset("Department") a2.Recordset("Identification Number") = z01 a2.Recordset("Rank") = z02 a2.Recordset("Name") = z03 a2.Recordset("Department") = z04 a1.Recordset.MoveNext a2.Recordset.Update Loop a1.Recordset.MoveFirst a1.Refresh a2.Recordset.MoveFirst a2.Refresh Form1.Caption = "To add Test1 Table File from Exam02 Database File" End Sub
85/
Exit Command Button twGuf Private Sub Command2_Click() Unload Me End End Sub ---------------0-0-0---------------
255
Microsoft Visual Basic 6.0
Access 2002 ½Sd Database File twGif;rS Table File twGif;½Sd Record tm;½Smjcif; 86/ atmufyg Form yHkpHtm; zefwD;wnfaqmufxm;&rnf/ yHk(265)/
yHk(265) 87/
yH(k 265)yg Form yHkpHwGif , , , , rsm;jzifh zefw;D xm;Ny;D oufqikd &f m Properties rsm;wGijf yifqifjznfph u G f NyD;aemuf Command Button rsm;wGifvdktyfaom y½dk*&rfrsm;a&;om;&efjzpfygonf/
88/
a1 - Adodc Properties twGuf (u) (Name) a1 ( c) Align 0 - vbAlignNone ( *) BOFAction 0 - adDoMoveFirst (C) ConnectingString provider=msdasql;dsn=exam02; uid=;pwd=; ( i) EOFAction 0 - adDoMoveLast ( p) Font MS Sans Serif, Bold, 8 (q) RecordSource select [Identification Number], Rank, Name, Department from Test1 order by [Identification Number]
89/
DataGrid1 - DataGrid Properties twGuf (u) (Name) DataGrid1 ( c) Align 0 - vbAlignNone ( *) AllowAddNew True (C) AllowArrows True ( i) AllowDelete True
256
uGefysLwmvufpJG ( p) AllowUpdate (q) Font ( Z) DataSource
-
True MS Sans Serif, Bold, 8 a1
90/
A1 - Adodc \ Record Position twGuf Private Sub a1_MoveComplete(ByVal adReason As ADODB.EventReason Enum, ByVal pError As ADODB.Error, adStatus As ADODB.Event StatusEnum, ByVal pRecordset As ADODB.Recordset) a1.Caption = "Record: " & CStr(a1.Recordset.AbsolutePosition) End Sub
91/
To Find Command Button twGuf Private Sub Command1_Click() Set DataGrid1.DataSource = a1 z1 = Text1 a1.Recordset.MoveFirst Do While a1.Recordset.EOF = False If a1.Recordset("Identification Number") = z1 Then Cls:Print Print a1.Recordset("Identification Number"), a1.Recordset ("Rank"),a1.Recordset("Name"), a1.Recordset ("Department") Exit Do Else Cls Print Print "Not Fount" End If a1.Recordset.MoveNext Loop End Sub
92/
Exit Command Button twGuf Private Sub Command2_Click() Unload Me End End Sub
257 93/
Microsoft Visual Basic 6.0
wpfzufyg Program udk Run yguatmufygtwdkif;jrifawGU&rnf/ yHk(266)/
yHk(266) ---------------0-0-0---------------
uGefysLwmvufpJG
258 Chapter (10)
Microsoft Visual 6.0 jzifh,cifoHk; Access zdkifwnfaqmufjcif; 1/ yxrOD;pGm Microsoft Visual 6.0 udzk iG yhf g/ xdaYk emuf yH(k 267)yg Form1 wGif Command Button udkoHk;í atmufygtwdkif;zefwD;&rnf/ Command Button
rsm;wGif oufqdkif&m y½dk*&rfrsm;a&;om;&rnf/ yHk(267) 2/
Open Database Command Button twGufPrivate Sub Command1_Click() Form1.Hide frmForm2.Show End Sub
3/
Exit Command Button twGufPrivate Sub Command2_Click() Unload Me End End Sub
4/
Menu Bar ½Sd Add-Ins udka½G;yg/ tay:qHk; Pulldown Menu wpfcjk zpfonfh Visual Data Manager uda k ½G;yg/ yH(k 268)/
yHk(268)
5/
xdt k cg VisData Window Dialog Box wpfckay:vmrnf/ yHk(269)/
259
Microsoft Visual Basic 6.0
yHk(269) 6/
4if; Window xJrS Menu Bar wpfckjzpfonfh File udka½G;cs,f&efjzpfonf/ New... udkxyfrHa½G;ygu Visual Basic 6.0 rSwnfaqmufEdkifonfh atmufygzdkifrsm; ay:vmayrnf/ yHk(270)/
yHk (270)
yH(k 270)yg yHrk S Microsoft Access 4udka½G;cs,f&rnf/ xdktcg Version 2.0 MDB... ESifh Version 7.0 MDB... wdkYay:vmayrnf/ yHk(271)/ 7/
8/
yHk(271) 4if;rS Version 7.0 udak ½G;cs,&f rnf/ xdt k cgzdik o f pfwnfaqmuf&ef zdik t f rnf
uGefysLwmvufpJG
260
topfawmif;onfh Dialog Box ay:vmrnf/ yH(k 272)/
yHk(272)
9/
yHk(272)wGif zdkiftrnfay;NyD; Save udak ½G;cs,yf g/ Oyrm/ Test01/ xdt k cg Database Window ay:vmrnf/ yH(k 273)/
yHk(273)
10/ yH(k 273)yg Database Window Dialog Box wGifyg0ifaom Properties udka½G;NyD; Right Click ESyd yf g/ xdt k cg Short Cut Menu wpfckyHk(274)ygtwdkif;ay: vmrnf/
yHk(274) 11/
Short Cut Menu rS New Table udka½G;cs,f&rnf/ xdktcg Table Struc-
261
Microsoft Visual Basic 6.0
ture Dialog Box ay:vmrnf/ yH(k 275)/
yHk(275)
12/ Table Name: List Box wGif Table File Name udr k rd pd w d Bf uKu d jf znfph u G yf g/ Oyrm/ Test01 [k owfrSwfNyD; Add Field Command Button udka½G;cs,f&rnf/ xdktcg Add Field Dialog Box ay:vmrnf/ 4if;wGif Field Name, Field Type, Field Size wdkYudk pdwfBuKdufjznfhpGufNyD;aemuf OK udk Click jyKvy k yf g/ yH(k 276)/
yHk(276)
13/
xdkaemuf Add Field Dialog Box xyfrHay:vmNyD; rdrdBuKdwifpDrHxm;aom Field Name, Field Type, Field Size rsm;udkowfrSwfNyD; OK udka½G;cs,f&rnf/ Field tm;vH;k owfrw S Nf y;D ygu Close Command Button udak ½G;cs,yf g/ yH(k 277)/
uGefysLwmvufpJG
262
yHk(277)
14/
xdktcg yHk(278)ygtwdkif;jrifawGU&rnf/
15/
Field Type wGifatmufyg vkyHyk(278) fydkifcGifhtcsufrsm;yg0ifonf -
263 (u) ( c) ( *) (C) ( i) ( p) (q) ( Z) ( ps) (n) ( #)
Microsoft Visual Basic 6.0
Boolean / Byte/ Integer/ Long/ Currency/ Single/ Double/ Date/Time / Text / Binary/ Memo /
16/
Field rsm;ay:wGifrlwnfNyD; Index jyKvy k v f ykd gu Add Index udak ½G;cs,yf g/ Add Index to Test01 Dialog Box ay:vmygu Name List Box wGif trnfowfrw S f yg/ Index Fields tm;rdrdowfrSwfvdkonfh Field Name udk Available Fields wGif Double Click jyKvkyfjcif;jzifhwnfaqmufEdkifayonf/ xdkYaemuf OK udo k wfrw S &f rnf/
yH(k 279)/
yHk(279)
17/ yHk(279)wGif OK udo k wfrw S v f u kd yf gu Table Structure Dialog Box ay: vmrnf/ yH(k 280)/
uGefysLwmvufpJG
264
yHk(280) 18/ yHk(280)wGif Close Command Button uda k ½G;cs,yf gu rdrw d nfaqmufxm; aom Table File qHk;½IH;oGm;Edkifonf/ xdkYaMumifh Build the Table Command Button udka½G;cs,f&rnf/ xdktcg yHk(281)yg twdkif; Database Window Dialog Box wpfck jyefvnfay:vmayrnf/
19/
xdkYaemuf Utility Menu rS yHData k(281)Form Designer... udak ½G;yg/ yH(k 282)/
265
Microsoft Visual Basic 6.0
yHk(282)
20/
xdt k cg yH(k 283)ygtwdik ;f Data Form Designer Dialog Box ay:vmrnf/
yHk(283)
21/ Form Name [w/o Extension]: List Box wGir f rd o d wfrw S v f o kd nfh trnfukd jznfph u G yf g/ Oyrm - Form2 [kjznfph u G Nf y;D RecordSource: List Box wGif Dropdown List Arrow udk Mouse jzif h Click jyKvkyfyg/ xdktcg Pulldown Menu xJrS rdrdzefwD;xm; onfh Table File tm;a½G;cs,fygu yHk(284)ygtwdkif;jzpfay:vmrnf/
uGefysLwmvufpJG
266
yHk(284)
22/
yHk(284)wGif Available Fields: xJrS rdrdtvdk½Sdonfh Field rsm;tm; Included Fields: List Box xJodkY > or >> jzify h yYkd g/ Oyrm - Fields tm;vH;k udak ½G;cs,yf g/ yHk(285)twdkif; jrifawGU&rnf/
yHk(285)
23/
xdkYaemuf Build the Form Command Button tm;a½G;cs,fyg/ qufvufí Close Command Button udka½G;cs,f&rnf/ xdktcg Data Entry jyKvkyf&ef Form wpfck&½Sdvmayrnf/ yHk(286)/
267
Microsoft Visual Basic 6.0
yHk(286)
24/
yH(k 286)yg Form yHkpHtm; yHk(287)ygtwdkif;odrf;qnf;&rnf/
yHk(287)
25/ Text Box,
Form2 wGifyg0ifaom Toolbox Icon rsm;udkavhvmygu Command Button,
Label,
Data wdkYyg0ifNyD; 4if;wdkY\ Properties rsm;udk
jyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif vdktyfaomy½dk*&rfrsm;a&;om; &rnfjzpfonf/ 26/
lblLabels(0) - Label Properties rSm (u) (Name) lblLabels ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle Opaque
268
uGefysLwmvufpJG ( i) ( p) (q) ( Z) ( ps)
Caption DataFormat Font Index WordWrap -
LabourID: General MS Sans Serif, Regular, 8 0 False
27/
lblLabels(1) - Label Properties rSm (u) (Name) lblLabels ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle Opaque ( i) Caption Name: ( p) DataFormat General (q) Font MS Sans Serif, Regular, 8 ( Z) Index 1 ( ps) WordWrap False
28/
lblLabels(2) - Label Properties rSm (u) (Name) lblLabels ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle Opaque ( i) Caption Date of Birth: ( p) DataFormat General (q) Font MS Sans Serif, Regular, 8 ( Z) Index 2 ( ps) WordWrap False
29/
lblLabels(3) - Label Properties rSm (u) (Name) lblLabels ( c) Alignment 0 - Left Justify ( *) AutoSize False
269 (C) ( i) ( p) (q) ( Z) ( ps)
BackStyle Caption DataFormat Font Index WordWrap -
Microsoft Visual Basic 6.0
Opaque Salary: General MS Sans Serif, Regular, 8 3 False
30/
txtFields(0) - Text Properties rSm (u) (Name) txtFields ( c) Alignment 0 - Left Justify ( *) BorderStyle1 - Fixed Single (C) DataField LabourID ( i) DataFormat General ( p) DataSource Data1 (q) Font MS Sans Serif, Regular, 8 ( Z) Index 0 ( ps) MultiLine False
31/
txtFields(1) - Text Properties rSm (u) (Name) txtFields ( c) Alignment 0 - Left Justify ( *) BorderStyle1 - Fixed Single (C) DataField Name ( i) DataFormat General ( p) DataSource Data1 (q) Font MS Sans Serif, Regular, 8 ( Z) Index 1 ( ps) MultiLine False
32/
txtFields(2) - Text Properties rSm (u) (Name) txtFields ( c) Alignment 0 - Left Justify
270
uGefysLwmvufpJG ( *) (C) ( i) ( p) (q) ( Z) ( ps)
BorderStyleDataField DataFormat DataSource Font Index MultiLine -
1 - Fixed Single Date of Birth General Data1 MS Sans Serif, Regular, 8 2 False
33/
txtFields(3) - Text Properties rSm (u) (Name) txtFields ( c) Alignment 0 - Left Justify ( *) BorderStyle1 - Fixed Single (C) DataField Salary ( i) DataFormat General ( p) DataSource Data1 (q) Font MS Sans Serif, Regular, 8 ( Z) Index 3 ( ps) MultiLine False
34/
Data1 - Data Properties (u) (Name) ( c) Align ( *) BOFAction (C) DatabaseName
rSm-
( i) ( p) (q) ( Z)
-
35/
EOFAction ReadOnly RecordsetType RecordSource
-
Data1 2 - Align Bottom 0 - Move First C:\Program Files\Microsoft VisualStudio\VB98\Test01.mdb 0 - Move Last False 1 - Dynaset Test01
cmdAdd - Command Button Properties rSm -
271 (u) (Name) ( c) Caption ( *) Font
-
Microsoft Visual Basic 6.0
cmdAdd &Add MS Sans Serif, Regular, 8
36/
cmdDelete - Command Button Properties rSm (u) (Name) cmdDelete ( c) Caption &Delete ( *) Font MS Sans Serif, Regular, 8
37/
cmdRefresh - Command Button Properties rSm(u) (Name) cmdRefresh ( c) Caption &Refresh ( *) Font MS Sans Serif, Regular, 8
38/
cmdUpdate - Command Button Properties rSm (u) (Name) cmdUpdate ( c) Caption &Update ( *) Font MS Sans Serif, Regular, 8
39/
cmdClose - Command Button Properties rSm (u) (Name) cmdClose ( c) Caption &Close ( *) Font MS Sans Serif, Regular, 8
40/
Add Command Button twGuf Private Sub cmdAdd_Click() Data1.Recordset.AddNew End Sub
41/
Delete Command Button twGuf Private Sub cmdDelete_Click() 'this may produce an error if you delete the last 'record or the only record in the recordset Data1.Recordset.Delete
uGefysLwmvufpJG
272
Data1.Recordset.MoveNext End Sub
42/
Refresh Command Button twGuf Private Sub cmdRefresh_Click() 'this is really only needed for multi user apps Data1.Refresh End Sub
43/
Update Command Button twGuf Private Sub cmdUpdate_Click() Data1.UpdateRecord Data1.Recordset.Bookmark = Data1.Recordset.LastModified End Sub
44/
Close Command Button twGuf Private Sub cmdClose_Click() frmForm2.Hide Form1.Show End Sub
45/
Error twGuf Private Sub Data1_Error(DataErr As Integer, Response As Integer) 'This is where you would put error handling code 'If you want to ignore errors, comment out the next line 'If you want to trap them, add code here to handle them MsgBox "Data error event hit err:" & Error$(DataErr) Response = 0 'throw away the error End Sub
46/
Record Position twGufPrivate Sub Data1_Reposition() Screen.MousePointer = vbDefault On Error Resume Next 'This will display the current record position
273
Microsoft Visual Basic 6.0
'for dynasets and snapshots Data1.Caption = "Record: " & (Data1.Recordset.AbsolutePosition + 1) 'for the table object you must set the index property when 'the recordset gets created and use the following line 'Data1.Caption = "Record: " & (Data1.Recordset.RecordCount * (Data1.Recordset.PercentPosition * 0.01)) + 1 End Sub
47/
Data1 Validate twGufPrivate Sub Data1_Validate(Action As Integer, Save As Integer) 'This is where you put validation code 'This event gets called when the following actions occur Select Case Action Case vbDataActionMoveFirst Case vbDataActionMovePrevious Case vbDataActionMoveNext Case vbDataActionMoveLast Case vbDataActionAddNew Case vbDataActionUpdate Case vbDataActionDelete Case vbDataActionFind Case vbDataActionBookmark Case vbDataActionClose End Select Screen.MousePointer = vbHourglass End Sub
----------0-0-0---------,cifoHk; Access zdkifudk Data Report wnfaqmufí Report wnfaqmufjcif;
uGefysLwmvufpJG
274
48/ yxrOD;pGm Microsoft Visual 6.0 udzk iG yhf g/ xdaYk emuf yH(k 288)yg Form1 wGif Command Button udkoHk;í atmufygtwdkif;zefwD;&rnf/
yHk(288)
49/ xdkYaemuf Menu Bar ½Sd Project udka½G;yg/ xdkYaemuf Pulldown Menu xJrS Add Data Report udkxyfrHa½G;cs,f&rnf/ yHk(289)/
yHk(289)
50/
yHk(290)ygtwdkif; Project1 - DataReport1 [DataReport] Form ay:
275
Microsoft Visual Basic 6.0
vmayrnf/
yHk(290)
51/ txufyg Report Form yHpk t H m;zefw;D vdu k o f nfEiS hf Project Explorer wGif vnf; yHk(291)ygtwdkif; DataReport1(DataReport1) topfwpfckwdk;vmayrnf/
yHk(291)
52/
txufyg Report Form yHpk t H m;trnfajymif;vJ&ayrnf/ Properties - Data Report1 wGif Name ü RDataReport1 [kajymif;vJowfrw S yf g/ yH(k 292)/
uGefysLwmvufpJG
276
yHk(292)
53/
Project Explorer wG i f v nf ; yH k ( 293)ygtwd k i f ; RDataReport1 (DataReport1) [ktrnfajymif;oGm;ayrnf/
yHk(292)
54/ tqdyk g RDataReport1(RDataReport1) File udo k rd ;f vdyk gu Menu Bar ½Sd File udka½G;cs,fyg/ xdkYaemuf Save Project udkxyfrHa½G;cs,fygu Save File As Dialog Box ay:vmrnf/ Save Command Button udka½G;cs,f&rnf/ yHk(293)/
277
Microsoft Visual Basic 6.0
yHk(293)
55/ xyfrHí Menu Bar jzpfaom Project rS More ActiveX Designers... udk a½G;cs,&f rnf/ xdt k cg Data Environment qdo k nfh Sub-Menu wpfcx k yfraH y:vmrnf/ 4if;udkxyfrHa½G;cs,fyg/ yHk(294)/
yHk(294)
56/
xdktcg yHk(295)wGifazmfjyxm;aom Project1 - DataEnvironment1
uGefysLwmvufpJG
278
[DataEnvironment] Dialog Box ay:vmayrnf/ 4if;udktrnfajymif;&ef Properties udka½G;í Properties-DataEnvironment wGif Name RDataEnvironment1 [k
ajymif;vJowfrSwf&rnf/ yHk(296)/
yHk(295)
yHk(296)
57/
Project Explorer wG i f v nf ; yH k ( 297)ygtwd k i f ; RDataReport1 (DataReport1) [ktrnfajymif;oGm;ayrnf/
279
Microsoft Visual Basic 6.0
yHk(297)
58/
xdak emuf Project1 - RDataEnvironment [DataEnvironment] wGif Connection1 udka½G;í Right Click udE k ydS yf g/ Short Cut Menu ay:vmygu yHk(298)wGif azmfjyxm;onfhtwdkif; Properties... udk xyfrHa½G;cs,fyg/
yHk(298)
59/
xdt k cg Data Link Properties Dialog Box ay:vmrnf/ 4if;rS Provider
uGefysLwmvufpJG
280
Tab Command Button udka½G;í Microsoft Jet 3.51 OLE DB Provider udka½G;cs,f
yg/ yH(k 299)/
yHk(299)
60/ xdkYaemuf Connection Tab Command Button udak ½G;cs,yf g/ yH(k 300)yg twdkif; 1. Select or enter a database name: List Box wGif Database File Name awmif;ygu rdrdudk,fwdkif Database File Name ½dkufxnfhjcif;jzifhvnf;aumif;? udk xyfrHa½G;cs,fjcif;jzifhvnf;aumif; tvdk½Sdaom Database File Name udka½G;cs,fyg/ yH(k 301)/
281
Microsoft Visual Basic 6.0
yHk(300)
yHk(301)
61/
Test Connection udka½G;cs,fygu rdrda½G;cs,fcJhaom Database File ESifh
Path vrf;aMumif;rSefuefygu yHk(302)ygtwdkif;azmfjyrnfjzpfonf/
yHk(302)
62/
xdkenf;wl Data Link Properties Dialog Box \ Tab Command But-
uGefysLwmvufpJG
282
ton rsm;jzpfMuaom Advanced yH(k 303) ESihf All yH(k 304)wdw Yk iG rf nfonft h csurf Q ajymif;vJ &efrvdkbJ OK udka½G;cs,f&efjzpfygonf/
yHk(303)
yHk(304)
63/
xdak emuf Project1 - RDataEnvironment [DataEnvironment] wGif Con-
283
Microsoft Visual Basic 6.0
nection1 udka½G;í Right Click udE k ydS yf g/ Short Cut Menu ay:vmygu yHk(305)wGif azmfjyxm;onfhtwdkif; Add Command udk xyfrHa½G;cs,fyg/
yHk(305)
64/
xdktcg yHk(306)ygtwdkif; jzpfay:vmrnf/
yHk(306)
65/
tqdyk g RDataEnvironment1(RDataEnvironment1) File udo k rd ;f vdyk gu
uGefysLwmvufpJG
284
Menu Bar ½Sd File udka½G;cs,fyg/ xdkYaemuf Save Project udkxyfrHa½G;cs,fygu Save File As Dialog Box ay:vmrnf/ Save Command Button udak ½G;cs,& f rnf/ yH(k 307)/
yHk(307)
66/
Project Explorer jzpfonfh Project-Project1 Dialog Box wGifvnf; RDataEnvironment1(RDataEnvironment1) tpm; RDataEnvironment1 (RDataEnvironment1.Dsr) tjzpfajymif;vJoGm;rnf/ yHk(308)/
yHk(308)
67/
Project1 - RDataEnvironment [DataEnvironment] wGif Connection1
285
Microsoft Visual Basic 6.0
udka½G;í Right Click udEk ydS yf g/ Short Cut Menu ay:vmygu yHk(309)wGifazmfjyxm; onfhtwdkif; Properties udk xyfrHa½G;cs,fyg/
yHk(309)
68/
xdt k cg Command1 Properties Dialog Box wpfckay:vmrnf/ 4if;wGif General, Parameters, Relation, Grouping, Aggregates, Advanced qdkonfh Tab Command Button (6)ckay:vmrnf/ 4if; Tab Command rsm;xJrS General Tab Command uda k ½G;yg/ yH(k 310)/
uGefysLwmvufpJG
286
yHk(310)
69/
Source of Data acgif;pOfatmufwGif½Sdaom Database Object: List Box Dropdown Arrow udka½G;í Table udkajymif;yg/ Object Name: List Box wGif Dropdown Arrow tultnDjzifr h rd zd efw;D xm;cJah om Test01 udak ½G;cs,&f rnf/ yH(k 311)/
yHk(311)
70/
usef Tab Command Button rsm;tm;jyKjyifp&mrvdak wmhonft h wGuf Apply -> OK uda k ½G;cs,yf g/ xdt k cg Project1 - DataEnvironment1 [DataEnvironment] Dialog Box ½Sd \ udka½G;ygu yHk(312)wGif azmfjyxm;ouJhodkY Field Name rsm;azmfjyaeayrnf/
287
Microsoft Visual Basic 6.0
yHk(312)
71/ xdaYk emuf Project1 - RDataReport1 [DataReport] udjk yefvnfqw GJ if&rnf/ yH(k 313)/
yHk(313)
72/
Page Header (Section2) Activate jzpfaeaomtcg Right Click udE k ydS yf g/ Short Cut Sub-Menu wpfckay:vmrnf/ 4if;rS Insert Control udka½G;NyD; Label
udkxyfrH a½G;cs,f&rnf/ yHk(314)/
uGefysLwmvufpJG
73/
288
yHk(314) xdktcg yHk(315)ygtwdkif;jzpfay:vmrnf/
yHk(315)
74/
xdkenf;twdkif; Label (4)ckzefwD;NyD; Labour ID, Name, Date of Birth,
289
Microsoft Visual Basic 6.0
Salary ponfjzifhtrnfowfrSwfyg/ yHk(316)? yHk(317)/
yHk(316)
yHk(317) 75/ Detail (Section1) Activate jzpfaeaomtcg Right Click udE k ydS yf g/ Short Cut Sub-Menu wpfckay:vmrnf/ 4if;rS Insert Control udka½G;NyD; TextBox udkxyfrH a½G;cs,f&rnf/ yHk(318)/
uGefysLwmvufpJG
76/
290
yHk(318) xdktcg yHk(319)ygtwdkif;jzpfay:vmrnf/
291
77/
78/
Microsoft Visual Basic 6.0
yHk(319) xdkenf;twdkif; TextBox (4)ckzefw;D &rnf/ yH(k 320)/
yHk(320)
Project1 - RDataReport1 [DataReport] Activate jzpfaeaomtcg Smart Icon jzpfaom \tultnDjzifh yHk(321)wGifazmfjyxm;onfhtwdkif; Properties - RDataReport1 ü DataSource wGif List Dropdown Arrow jzifh RData Environment1 udka½G;cs,f&rnf/ DataMember wGif List Dropdown Arrow jzifh Command1 udkxyfrHa½G;cs,f&rnf/
uGefysLwmvufpJG
292
yHk(321)
79/
Detail (Section1) Activate jzpfap&efjyKvy k í f yxrOD;qH;k jrifawGUae&onfh Text Box uda k ½G;yg/ Smart Icon jzpfaom \tultnDjzifh yHk(322)wGifazmfjyxm;
onfhtwdkif; Properties - Text1 ü DataMember \ List Dropdown Arrow jzifh Command1 udkvnf;aumif;? DataField \ List Dropdown Arrow jzifh LabourID ud k v nf ; aumif ; a½G ; cs,f & rnf / xd k e nf ; wl u sef Text Box toD ; oD ; ud k v nf ; DataMember, DataField wdkYudkqDavsmfatmifjyKvkyf&rnf/ yHk(323)/
293
yHk(322)
yHk(323)
Microsoft Visual Basic 6.0
uGefysLwmvufpJG
294
yHk(324)
80/ txufyg yHk(324)udkjyefoGm;NyD; oufqdkif&m Command Button rsm;wGif atmufazmfjyyg yHk(325)ygtwdkif; Coding rsm;udka&;&rnf/
yHk(325)
rSwcf su/f /
DataReport toH;k jyKygu DataEnvironment udkoHk;&rnf jzpfonf/ DataEnvironment wGif Database File rwlny D gu Connection1, Connection2, ... [lí cJGjcm;toHk;jyKEdkifNyD; Database File wlnDNyD; Table File (rwlnDvQif) rsm;jym; aeygu Command1, Command2, ... zefw;D ítoH;k jyKEikd yf gonf/
----------0-0-0----------
uGefysLwmvufpJG
295
,cifoHk; Access zdkifudk Form wnfaqmufí"gwfyHkrsm;Munfhjcif; 81/ yxrOD;pGm Microsoft Visual 6.0 udzk iG yhf g/ xdaYk emuf yH(k 326)yg Form1 wGif Command Button rsm;udkoHk;í atmufygtwdkif;zefwD;NyD; vdktyfaomy½dk*&rfrsm; a&;om;&rnf/
yHk(326)
82/
Data Entry Command Button twGufPrivate Sub Command1_Click() frmForm2.Show End Sub
83/
Exit Command Button twGufPrivate Sub Command2_Click() Unload Me End End Sub
84/
xdkYaemuf yHk(327)yg frmForm2 wGifvdktyfaom Label, TextBox, OLE, Data, Command Button rsm;udo k ;kH &rnf/ vdt k yfaom Properties rsm;udv k nf;jyifqif& rnf/
296
uGefysLwmvufpJG
yHk(327)
OLE
Data
85/
lblLabels(0) - lblLabels Properties twGuf(u) (Name) lblLabels ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle 1 - Opaque ( i) Caption LabourID: ( p) Font MS Sans Serif, Regular, 8 (q) Index 0 ( Z) WordWrap False
86/
lblLabels(1) - lblLabels Properties twGuf(u) (Name) lblLabels ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle 1 - Opaque ( i) Caption Name: ( p) Font MS Sans Serif, Regular, 8 (q) Index 1 ( Z) WordWrap False
297
Microsoft Visual Basic 6.0
87/
lblLabels(2) - lblLabels Properties twGuf(u) (Name) lblLabels ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle 1 - Opaque ( i) Caption Date of Birth: ( p) Font MS Sans Serif, Regular, 8 (q) Index 2 ( Z) WordWrap False
88/
lblLabels(3) - lblLabels Properties twGuf(u) (Name) lblLabels ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle 1 - Opaque ( i) Caption Salary: ( p) Font MS Sans Serif, Regular, 8 (q) Index 1 ( Z) WordWrap False
89/
lblLabels(4) - lblLabels Properties twGuf(u) (Name) lblLabels ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle 1 - Opaque ( i) Caption Photos: ( p) Font MS Sans Serif, Regular, 8 (q) Index 1 ( Z) WordWrap False
90/
txtFields(0) - txtFields Properties twGuf(u) (Name) txtFields ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField LabourID ( i) DataFormat General ( p) DataSource Data1
298
uGefysLwmvufpJG (q) Font ( Z) Index ( ps) MultiLine
-
MS Sans Serif, Regular, 8 0 False
91/
txtFields(1) - txtFields Properties twGuf(u) (Name) txtFields ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Name ( i) DataFormat General ( p) DataSource Data1 (q) Font MS Sans Serif, Regular, 8 ( Z) Index 1 ( ps) MultiLine False
92/
txtFields(2) - txtFields Properties twGuf(u) (Name) txtFields ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Date of Birth ( i) DataFormat General ( p) DataSource Data1 (q) Font MS Sans Serif, Regular, 8 ( Z) Index 2 ( ps) MultiLine False
93/
txtFields(3) - txtFields Properties twGuf(u) (Name) txtFields ( c) Alignment 0 - Left Justify ( *) BorderStyle 1 - Fixed Single (C) DataField Salary ( i) DataFormat General ( p) Font MS Sans Serif, Regular, 8 (q) Index 3 ( Z) MultiLine False
299
Microsoft Visual Basic 6.0
94/
oleFields(0) - oleFields Properties twGuf(u) (Name) oleFields ( c) AutoActivate 2 - DoubleClick ( *) BackStyle 1 - Opaque (C) BorderStyle 1 - Fixed Single ( i) DataField Photos ( p) DataSource Data1 (q) Font MS Sans Serif, Regular, 8 ( Z) Index 0 ( ps) OLEDropAllowed False (n) OLETypeAllowed 2 - Either ( #) SizeMode Stretch
95/
cmdAdd - Command Button Properties rSm (u) (Name) cmdAdd ( c) Caption &Add ( *) Font MS Sans Serif, Regular, 8
96/
cmdDelete - Command Button Properties rSm (u) (Name) cmdDelete ( c) Caption &Delete ( *) Font MS Sans Serif, Regular, 8
97/
cmdRefresh - Command Button Properties rSm (u) (Name) cmdRefresh ( c) Caption &Refresh ( *) Font MS Sans Serif, Regular, 8
98/
cmdUpdate - Command Button Properties rSm (u) (Name) cmdUpdate ( c) Caption &Update ( *) Font MS Sans Serif, Regular, 8
99/
cmdClose - Command Button Properties rSm (u) (Name) cmdClose ( c) Caption &Close ( *) Font MS Sans Serif, Regular, 8
300
uGefysLwmvufpJG 100/
Data1 - Data Properties rSm (u) (Name) ( c) Align ( *) BOFAction (C) Connect ( i) DatabaseName -
( p) (q) ( Z) ( ps) (n)
EOFAction Font ReadOnly RecordsetType RecordSource
-
Data1 0 - None 0 - Move First Access C:\Program Files\Microsoft Visual Studio\VB98\Test01.mdb 0 - Move Last MS Sans Serif, Regular, 8 False 1 - Dynaset Test01
101/
Add Command Button twGuf Private Sub cmdAdd_Click() Data1.Recordset.AddNew End Sub
102/
Delete Command Button twGuf Private Sub cmdDelete_Click() 'this may produce an error if you delete the last 'record or the only record in the recordset Data1.Recordset.Delete Data1.Recordset.MoveNext End Sub
103/
Refresh Command Button twGuf Private Sub cmdRefresh_Click() 'this is really only needed for multi user apps Data1.Refresh End Sub
104/
Update Command Button twGuf Private Sub cmdUpdate_Click() Data1.UpdateRecord Data1.Recordset.Bookmark = Data1.Recordset.LastModified End Sub
301
Microsoft Visual Basic 6.0
105/
Close Command Button twGuf Private Sub cmdClose_Click() frmForm2.Hide Form1.Show End Sub
106/
Error twGuf Private Sub Data1_Error(DataErr As Integer, Response As Integer) 'This is where you would put error handling code 'If you want to ignore errors, comment out the next line 'If you want to trap them, add code here to handle them MsgBox "Data error event hit err:" & Error$(DataErr) Response = 0 'throw away the error End Sub
107/
Record Position twGufPrivate Sub Data1_Reposition() Screen.MousePointer = vbDefault On Error Resume Next 'This will display the current record position 'for dynasets and snapshots Data1.Caption = "Record: " & (Data1.Recordset.AbsolutePosition + 1) 'for the table object you must set the index property when 'the recordset gets created and use the following line 'Data1.Caption = "Record: " & (Data1.Recordset.RecordCount * (Data1.Recordset.PercentPosition * 0.01)) + 1 End Sub
108/
Data1 Validate twGufPrivate Sub Data1_Validate(Action As Integer, Save As Integer) 'This is where you put validation code 'This event gets called when the following actions occur Select Case Action Case vbDataActionMoveFirst Case vbDataActionMovePrevious Case vbDataActionMoveNext Case vbDataActionMoveLast
uGefysLwmvufpJG
302
Case vbDataActionAddNew Case vbDataActionUpdate Case vbDataActionDelete Case vbDataActionFind Case vbDataActionBookmark Case vbDataActionClose End Select 'Screen.MousePointer = vbHourglass End Sub
109/
OLEField Double Click twGufPrivate Sub oleFields_DblClick(Index As Integer) 'this is the way to get data into an empty ole control 'and have it saved back to the table oleFields(Index).InsertObjDlg End Sub
----------0-0-0---------Toolbox xJwGif Crystal Report Smart Icon xnfhjcif; 110/ Toolbox wGif Right Click ESy d yf g/ xdt k cg Short Cut Menu ay:vmygu Components... udkxyfrHa½G;cs,f&rnf/ yHk(328)/
yHk(328)
303
Microsoft Visual Basic 6.0
111/ Components Dialog Box ay:vmygu Crystal Report Control 4.6 udk a½G;NyD; Check vkyf&rnf/ xdkYaemuf Apply, OK udkxyfrHa½G;cs,f&rnf/ yHk(329)/
yHk(329)
112/
Crystal Report Control 4.6 ud k a ½G ; Ed k i f j cif ; onf C:\WINDOWS\ SYSTEM\CRYSTL32.OCX zdkif½Sdjcif;aMumifhjzpfonf/ xdktcg Toolbox ü Crystal Report Icon a&muf½v dS mrnf/ yH(k 330)/
yHk(330)
----------0-0-0----------
uGefysLwmvufpJG
304
Crystal Report wnfaqmufjcif; ( ,cif Access File ) 113/ yxrOD;pGm Visual Basic 6.0 udzk iG yhf g/ xdaYk emuf Menu Bar rS Add-Ins udk a½G;í Pulldown Menu wpfcjk zpfaom Report Designer... udak ½G;cs,&f rnf/ yH(k 331)
yHk(331)
114/
yHk(332)ygtwdkif;jzpfay:vmygu Cancel Command Button udak ½G;cs,yf g/
yHk(332)
305
Microsoft Visual Basic 6.0
115/ Crystal Reports Registration Express Dialog Box aysmufomG ;vdrr hf nf/ xdt k cg Report wnfaqmuf&eftqifoifhjzpfaeayvdrfhrnf/ Crystal Reports Pro Dialog Box wGif New... udkyHk(333)wGifa½G;yguyHk(334)ygtwdkif; Create New Report Dialog Box jzpfay:vmrnf/
yHk(333)
yHk(334)
116/ Create New Report Dialog Box xJrS Standard udkxyfrHa½G;cs,fygu yHk(335)ygtwdkif;jzpfay:vmayrnf/
uGefysLwmvufpJG
306
yHk(335)
117/ Create Report Expert Dialog Box wGif Data File Command Button udk xyfrHa½G;cs,f&rnf/ yHk(336)/
yHk(336)
118/
Choose Database File Dialog Box xyfrHay:vmNyD; rdrdtoHk;jyKvdkonfh Database File udkxyfrHa½G;cs,f&ef List Files of Type:List Box udk Access Files (or) User Default [kajymif;yg/ rdrdtvdk½Sdonfh Drives:, Directories: wdkYtm; ajymif;vJí tvdk½Sdonfh Microsoft Database File udka½G;cs,fNyD; Add Command Button udk a½G;cs,f&rnf/ yHk(337)/
307
Microsoft Visual Basic 6.0
yHk(337) 119/ Choose Database File Dialog Box \trSm;jcpf Close Button udka½G;jcif; jzifh aomfvnf;aumif;? Done Command Button udak ½G;jcif;jzifah omfvnf;aumif; xyfrH aqmif½u G &f rnf/ xdt k cg Choose Database File Dialog Box aysmufomG ;rnf/ yH(k 338)
uGefysLwmvufpJG
308
yHk(338)
120/
Create Report Expert Dialog Box wGif Step 1: Tables, 2: Fields, 3: Sort, 4: Total, 5: Select, 6: Style [lí Tab Command (6)ck 0ifyg0ifNyD; 2: Fields
tm;xyfraH ½G;cs,yf g/ yH(k 339)/
yHk(339)
121/ Database Fields: acgif;pOfatmuf½Sd Database Fields: rsm;xJrS rdrdtvdk½Sd aom Field rsm;tm; Report Fields: acgif;pOfatmufoyYkd &Ykd rnf/ Field wpfcck si;f a½G;vdk ygu Command Button jzif h a ½G ; cs,f N yD ; Field tm;vH k ; a½G ; vd k y gu Command Button jzifha½G;cs,f&rnf/ yHk(340)/
309
Microsoft Visual Basic 6.0
yHk(340) 122/
xdkYaemuf Next>> Command Button udak ½G;cs,yf g/ yH(k 341)/
yHk(341) 123/ xdt k cg Tab Command wpfcjk zpfaom 3: Sort odaYk &muf½o dS mG ;rnf/ txufyg yHk(341)wGif rdrdtkyfpkzJGUvdkonfh Field tm; tkyfpkzJGUEdkifonf/ tkyfpkzJGU&ef rvdktyfygu Preview Report udx k yfraH ½G;yg/ yH(k 342)/
uGefysLwmvufpJG
310
yHk(342) 124/ txufygyHw k iG af zmfjyxm;aom Design tm;a½G;cs,yf gu yH(k 343)twdik ;f jyKjyif rGrf;rHEdkif&ef tajctaeay;vdrfhrnf/
311
Microsoft Visual Basic 6.0
yHk(343)
125/
xdaYk emuf Menu Bar ½Sd Insert udak ½G;cs,yf g/ Pulldown Menu wpfcjk zpfaom Text Field uda k ½G;cs,yf g/ yH(k 344)/
uGefysLwmvufpJG
312
yHk(344)
126/ xdt k cg Edit Text Field Dialog Box ay:vmNyD; acgif;pOftm;rdrdpdwfBuKduf zefwD;í&ayonf/ yHk(345)/ xdkYaemuf Accept Command Button udak ½G;cs,yf g/
yHk(345)
127/ acgif;pOftm; Alignment csdef&efrdrd½dkufESdyfxm;onfh acgif;pOf Text Box tm; a½G;NyD; Right Click udak ½G;yg/ Short Cut Menu ay:vmrnf/ xdkYaemuf Change Format... udka½G;cs,f&rnf/ yHk(346)/
313
Microsoft Visual Basic 6.0
yHk(346)
128/
xdt k cg Format String Dialog Box ay:vmrnf/ yHk(347)4if;rS Alignment wGif Centered udk a½G;Ny;D OK udx k yfraH ½G;cs,yf gu acgif;pOfpmom; tv,fño §d mG ; ayrnf/ yHk(348)
yHk(347)
uGefysLwmvufpJG
314
yHk(348)
129/ txufyg Report File tm;odr;f vdyk gu Menu Bar ½Sd File udak ½G;cs,yf g/ xdkYaemuf Pulldown Menu xJrS Save udka½G;cs,fyg/ yHk(349)
yHk(349)
315
Microsoft Visual Basic 6.0
130/ xdt k cg File Save As Dialog Box ay:vmrnf/ rdrdpdwfBuKdufodrf;vdkonfh zdkiftrnfudkay;NyD; OK udk Click vky&f rnf/ yH(k 350)/
yHk(350)
131/ Crystal Reports Title Bar onfvnf; [Untitled Report #1] r[kwfawmh bJ [c:\program files\microsoft visual studio\vb98\std09.rpt] [líajymif;vJomG ;ay rnf/ yH(k 351)/
yHk(351) ----------0-0-0----------
uGefysLwmvufpJG
316
Crystal Report wnfaqmufjcif; ( Access File 2000 txuf ) 132/ yxrOD;pGm Visual Basic 6.0 udzk iG yhf g/ xdaYk emuf Menu Bar rS Add-Ins udk a½G;í Pulldown Menu wpfcjk zpfaom Report Designer... udka½G;cs,f&rnf/ Create Report Expert Dialog Box a&mufonftxdtqifhqifhjyKvkyfNyD; SQL/ODBC Command Button udka½G;cs,f&rnf/ yHk(352)
yHk(352)
133/
xdt k cg Log On Server Dialog Box topfwpfckay:vmrnf/ yHk(353)
yHk(353)
134/ yH(k 353)yg Dialog Box rS ODBC:exam01 udka½G;cs,fyg/ xdkYaemuf OK udk Click vkyyf g/ xdt k cg Choose SQL Table Dialog Box ay:vmrnf/ yH(k 354)/
317
Microsoft Visual Basic 6.0
yHk(354)
135/
Choose SQL Table Dialog Box xJrS SQL Tables: acgif;pOfatmuf½Sd List Box wGif rdrp d w d Bf uKu d f Table File udadk ½G;cs,&f rnf/ Oyrm - exam01 udak ½G;cs,yf g/ Add Command Button udkxyfrHa½G;cs,fyg/ Close Button udka½G;cs,fygu yHk(355)
ygtwdkif;jzpfvmrnf/
yHk(355)
136/ yHk(355)wGif Next >> Command Button udkxyfrHa½G;cs,f&rnf/ yHk(356)yg twdkif;azmfjyrnf/
uGefysLwmvufpJG
318
yHk(356)
137/ txufygyHk(356)wGif Database Fields: ü Field rsm;pdwfBuKduf(odkYr[kwf) tm;vH;k udk a½G;cs,Ef ikd af yonf/ Oyrm-Fields rsm;tm;vH;k a½G;cs,&f ef All->>Command Button udka½G;cs,f&rnf/ yHk(357)
yHk(357)
138/
xdkYaemuf Next udkxyfrHa½G;cs,fyg/ yHk(358)ygtwdkif;azmfjyrnf/
319
Microsoft Visual Basic 6.0
yHk(358)
139/ txufygyH(k 358)wGif Group Fields aqmif½u G v f ykd gu vkyyf ikd cf iG ahf y;xm;Ny;D raqmif½Gufvdkygu Preview Report Command Button udka½G;cs,f&rnf/ xdktcg yHk(359)twdkif; jzpfay:vmrnf/
yHk(359)
uGefysLwmvufpJG 140/ rnf/
320
Design Tab Command Button udak ½G;cs,y f gu yH(k 360)ygtwdik ;f jzpfay:vm
yHk(360) 141/
txufygyHk(360)wGifazmfjyxm;aom Crystal Report File tm;odr;f vdyk gu Menu Bar wGif½Sdonfh File uda k ½G;cs,yf g/ Pulldown Menu wpfckjzpfaom Save udk a½G;cs,yf g/ xdt k cg File Save As Dialog Box ay:vmrnf/ rdrdpdwfBuKdufvrf;aMumif; wGif Report File Name udkjznfhpGufNyD; OK Command Button udka½G;cs,f&rnf/ yH(k 361)/
321
Microsoft Visual Basic 6.0
yHk(361)
----------0-0-0---------Crystal Report jzifh Graphic File ½dkufxkwfjcif; 142/ yxrOD;pGm Visual Basic 6.0 wGif "gwfyrkH sm;yg0ifaom Access File udk wnfaqmufxm;&rnf/ "gwfyrkH sm;udk Windows BitMap File Format jzifo h m Data Entry jyKvy k &f rnf/ Access 2000 xufapmaom ,cif Access File rsm;twGufrl Crystal Report \vkyfydkifcGifhjzpfaom Create Report Expert Dialog Box ay:vm atmifzefwD;í Data File Command Button udka½G;&rnf/ Access 2000 ESifh txuf Access File rsm;twGufrl Crystal Report \vkyfydkifcGifhjzpfaom Create Report Expert Dialog Box ay:vmatmifzefwD;í SQL/ODBC File Command Button udk a½G;&rnf/
yHk(362)
uGefysLwmvufpJG
322
143/ xdt k cg Log On Server Dialog Box ay:vmrnf/ Server Type: acgif;pOf atmufwiG f rdrad ½G;cs,rf nfh Database File tm;½SmazG&rnf/ Oyrm - ODBC - Photo01 udka½G;cs,fyg/ xdkYaemuf OK udk Click vky&f rnf/ yH(k 363)/
yHk(363)
144/
Choose SQL Table Dialog Box ay:vmygu rdrdwnfaqmufxm;aom Database File xJwi G yf g0ifonfh Table File udka½G;cs,fNyD; Add Command Button
udk xyfrHa½G;cs,f&rnf/ yHk(364)/
yHk(364)
145/
Create Report Expert Dialog Box ay:vmNyD; Table File jzpfonfh Photo01 File ay:vmrnf/ yH(k 365)/
323
Microsoft Visual Basic 6.0
yHk(365)
146/ yHk(365)wGif Next >> Command Button udkxyfrHa½G;cs,f&rnf/ yHk(366)yg twdkif;azmfjyrnf/
yHk(366)
147/ txufygyHk(366)wGif Database Fields: ü Field rsm;pdwfBuKduf(odkYr[kwf) tm;vH;k udk a½G;cs,Ef ikd af yonf/ Oyrm-Fields rsm;tm;vH;k a½G;cs,&f ef All->>Command Button udka½G;cs,f&rnf/ yHk(367)
uGefysLwmvufpJG
324
yHk(367)
148/
xdkYaemuf Next udkxyfrHa½G;cs,fyg/ yHk(368)ygtwdkif;azmfjyrnf/
yHk(368)
149/ txufygyH(k 368)wGif Group Fields aqmif½u G v f ykd gu vkyyf ikd cf iG ahf y;xm;Ny;D raqmif½Gufvdkygu Preview Report Command Button udka½G;cs,f&rnf/ xdktcg yHk(369)twdkif; jzpfay:vmrnf/
325
Microsoft Visual Basic 6.0
yHk(369)
150/ rnf/
Design Tab Command Button udak ½G;cs,y f gu yH(k 370)ygtwdik ;f jzpfay:vm
uGefysLwmvufpJG
326
yHk(370)
151/
Design View wGif Band (5)ckyg½Sr d nfjzpfonf/ Title, Page header, Details, Page footer, Summary wdjYk zpfMuonf/ Title onf acgif;pOfBuD;twGufjzpfNyD;? Page header onf pm½Guw f ikd ;f wGiyf g½Srd nfh tkypf ak cgif;pOfrsm;? &ufp?GJ pmrsuEf mS eHygwfrsm; jzpfEikd o f nf/ Details onf Record rsm;azmfjy&eftwGuf Template rsm;jzpfayonf/ Page footer onfpm½Gut f oD;oD;\atmufq;kH wGiyf g0if&rnfh &ufp?GJ pmrsuEf mS eHygwfrsm; jzpfEikd yf gonf/ Details ESifh Page footer udk"gwfyHkrsm;xnfhoGif;&efoifhwifhrQwpGmjcm; &rnf/ xdkYaemuf Menu Bar ½Sd Insert udak ½G;yg/ Pulldown Menu jzpfaom Database Field udkxyfrHa½G;cs,f&rnf/ yHk(371)
327
Microsoft Visual Basic 6.0
yHk(371)
152/ xdt k cg Insert Database Field Dialog Box rS Field wpfckjzpfaom photos udka½G;NyD; Insert Command Button udka½G;cs,f&rnf/ yHk(372)
yHk(372)
uGefysLwmvufpJG
328
153/ xdt k cg yH(k 373)ygtwdik ;f "gwfy½kH &dS rnft h uGuu f ckd sed q f í tpm;xd;k twnfjyKNy;D aomtcg Insert -> Text Field jzifh vdt k yfrnfph mom;rsm;a&;om;yg/ yH(k 374)/
yHk(373)
yHk(374)
154/
tqdyk g Crystal Report File tm; File -> Save udka½G;NyD; Report File Name ay;&efjzpfonf/ ----------0-0-0----------
329
Microsoft Visual Basic 6.0
Access zdkifudk Crystal Report wnfaqmufí Print ½dkufxkwfjcif; 155/ yH(k 375)yg Form1 wGif Command Button rsm;udkoHk;í atmufygtwdkif;
zefwD;wnfaqmufNyD; y½dk*&rfa&;&rnf/
yHk(375)
Crystal Report
Private Sub Command1_Click() CrystalReport1.PrintReport End Sub Private Sub Command2_Click() Unload Me End End Sub
156/ Microsoft Visual Basic 6.0 wGif Menu Bar wpfckjzpfaom Add-ins udk a½G;cs,fyg/ xdkYaemuf Pulldown Menu xJrS Report Designer... jzifh *.rpt File wpfzdkifudkwnfaqmufxm;&rnf/ Oyrm-c:\program files\microsoft visual studio\ vb98\ exam01.rpt udw k nfaqmufxm;&rnf/ yH(k 376)/
uGefysLwmvufpJG
157/
330
yHk(376) Crystal Report \ Properties wGi-f (u) (Name) CrystalReport1 ( c) BoundReportFooterFalse ( *) CopiesToPrinter 1 (C) Destination 0 - crptToWindow ( i) DetailCopies 1 ( p) DiscardSaveData False (q) Left 4200 ( Z) MarginBottom 0 ( ps) MarginLeft 0 (n) MarginRight 0 ( #) MarginTop 0 ( X) PrinterCollation 2 - crptDefault ( !) PrinterCopies 1 ( ¡) PrinterStopPage 0 (P) PrintFileType 0 - crptRecord (w) PrintFileUserRptDateFmt False (x) PrintFileUserRptNumberFmt False
331 ( ') ReportFileName
Microsoft Visual Basic 6.0 -
C:\Program Files\ Microsoft Visual Studio\VB98\ exam01.rpt ( ") ReportSource 0 - crptReport ( e) Top 960 ( y) WindowBorderStyle 2 - crptSizable ( z) WindowControlBox True ( A) WindowControls True (b) WindowHeight 300 ( r) WindowLeft 100 (,) WindowMaxButton True ( &) WindowMinButton True (v) WindowState 0 - crptNormal ( 0) WindowTop 100 (o) WindowWidth 490 ---------------0-0-0--------------Database File wpfcktwGif;½Sd Table zdkifESpfckudktoHk;jyKíuHprf;rJEIdufjcif; 158/ yxrOD;pGm Microsoft Visual Basic 6.0 \vkyfydkifcGifhwGifyg0ifaom Menu Bar rS Add-ins udka½G;cs,f&rnf/ xdkYaemuf Pulldown Menu jzpfaom Visual Data Manager... uda k ½G;cs,yf g/ yH(k 377)/
yHk(377)
159/ xdt k cg VisData Dialog Box ay:vmvdrfhrnf/ 4if;rS Menu Bar jzpfaom File udka½G;cs,fyg/ xdkYaemuf New udkxyfrHa½G;cs,f&rnf/ yHk(378)/
uGefysLwmvufpJG
332
yHk(378)
160/ yHk(378)ygtwdkif; New... udka½G;cs,fygu xyfrHí Sub-Menu wpfckay:vm rnf/ 4if;rS rdrzd efw;D wnfaqmufrnfh Microsoft Access udak ½G;cs,yf g/ xdt k cgxyfrí H Sub-Menu wpfckay:vmayrnf/ 4if; Sub-Menu rS Version 7.0 MDB... udka½G;cs,f &rnf/ yH(k 379)/ yH(k 380)ygtwdik ;f ay:vmrnf/
yHk(379)
333
Microsoft Visual Basic 6.0
yHk(380)
161/ yHk(380)wGif Select Microsoft Access Database to Create Dialog Box ay:vmygu rdrw d nfaqmuftrnfay;vdo k nfh Database File trnfujkd znfph u G í f Save Command Button udka½G;cs,f&ayrnf/ Oyrm - Lucky [kjznfhpGufNyD; Save Command Button uda k ½G;yg/ VisData Dialog Box wGif VisData:C:\Program\Lucky Draw\Lucky.mdb [k Title Bar üay:vmayrnf/ xdkYaemuf Database Window Dialog Box wpfckxyfrHay:vmrnf/ yHk(381)/
yHk(381)
uGefysLwmvufpJG
334
162/
Database Window Dialog Box wGif Properties udka½G;cs,fyg/ xdkYaemuf Right Click ESy d yf gu Sub-Menu wpfckay:vmrnf/ xdk Sub-Menu xJrS New Table
udak ½G;cs,yf g/ yH(k 382)/
yHk(382)
163/ xdt k cg Table Structure Dialog Box ay:vmrnf/ Table Name acgif;pOf ab; List Box ü rdrdpdwfBuKduf Table File trnfudkjznfhpGufí Add Field Command Button udka½G;cs,f&rnf/ yHk(383)/
yHk(383)
335
Microsoft Visual Basic 6.0
164/
Add Field Dialog Box ay:vmvdrfhrnf/ xdktcg rdrdtvdk½Sdonfh Field Name, Field Type, Field Size wdkYudkowfrSwf&rnf/ yHk(384)? yHk(385)/
yHk(384)
yHk(385)
165/
Field Name wpfcc k si;f oGi;f Ny;D ygu OK Command Button udak ½G;cs,&f rnf/ Field Name xyfrHroGif;vdkawmhygu Close Command Button uda k ½G;cs,yf g/ xdt k cg
yHk(386)ygtwdkif;jzpfay:vmrnf/
uGefysLwmvufpJG
336
yHk(386) 166/ Index Field owfrw S v f ykd gu Add Index Command Button udka½G;cs,f& rnf/ xdt k cg Add Index to Luck01 Dialog Box ay:vmygu Name List Box, Indexed Fields List Box wdkYtm; rdrdpdwfBuKdufowfrSwfNyD; OK Command Button udka½G;cs,fyg/ xyfrHí Close Command Button udka½G;cs,f&rnf? yHk(387)/
yHk(387)
337
Microsoft Visual Basic 6.0
167/ xdt k cg rlv Table Structure Dialog Box odkYjyefvnfa&muf½SdoGm;rnf/ yH(k 388)/
yHk(388) 168/
txufyg Table Structure udo k rd ;f vdyk gu Build the Table Command Button udka½G;cs,f&rnf/ rlv Database Window Dialog Box odkYjyefvnfa&muf½Sd oGm;ayrnf/ Close Command Button udka½G;cs,fygu tqdkyg Luck01 Table File udo k rd ;f rnfr[kwyf g/ yH(k 389)/
uGefysLwmvufpJG
338
yHk(389)
169/
C:\Program Files\LuckDraw\Lucky.mdb udkwnfaqmufNyD; Luck01 Table File ukw d nfaqmufcNhJ y;D jzpfonf/ ,cktcg 4if; Database File xJwiG yf if Luck02 Table File udx k yfrw H nfaqmuf&rnf/ Luck01 ESifh Luck02 Table File rsm;rSm tm;vH;k wlnDMuojzifh Luck02 Table File tm; Luck01 Table File uJhodkYyif tptqHk;jyef
wnfaqmufyguvnf;&onf/ jzwfvrf;enf;jzifw h nfaqmufvykd gu yH(k 389)wGif jrifawGU ae&aom Database Window Dialog Box rS Luck01 udka½G;yg/ xdkYaemuf Right Click ESy d yf g/ xdt k cg Short Cut Menu wpfckay:vmrnf/ yHk(390)/
yHk(390)
339
Microsoft Visual Basic 6.0
170/ Short Cut Menu xJrS Copy Structure... udkxyfrHa½G;cs,fyg/ xdktcg yH(k 391)yg Copy Structure Dialog Box ay:vmrnf/
yHk(391)
171/ 4if; Dialog Box rS Target Connect String: acgif;pOfatmuf Text Box ü Lucky [kjznfhpGufNyD; Table: acgif;pOfatmuf Text Box ü Luck01 udak ½G;cs,&f rnf jzpfNyD; Copy Data Check Box udk Check jyKvkyf&efjzpfonf/ xdkYaemuf OK Command Button uda k ½G;cs,yf g/ yH(k 392)/
yHk(392)
172/ xdktcg VisData Dialog Box ay:vmrnf/ Enter New Table Name acgif;pOfatmuf Text Box ü rdrdwnfaqmufvdkonfh Table Name udjk znfph u G &f rnf/ Oyrm - Luck02 [kjznfhpGufNyD; OK Command Button udka½G;cs,f&rnf/ yHk(394)/
uGefysLwmvufpJG
340
yHk(393)
173/ xdt k cg Copy Structure Dialog ay:vmrnf/ rdrdul;vdkonfh Structure atmifjrifpGmul;NyD;aMumif; Message Box ay:vmayrnf/ OK Command Button udak ½G;yg/ yH(k 394)/
yHk(394)
174/ xdt k cg Lucky.mdb Database File xJwGif Luck01 Table File ESifhtvm; oP²mefwlaom Luck02 Table File jzpfvmrnf/ yH(k 395)/
yHk(395)
341
Microsoft Visual Basic 6.0
175/ uH p rf ; rJ a zguf r nf h y½d k * &rf a &;om;&ef t wG u f a tmuf y g Form yHkpHudk wnfaqmuf&rnf/ yHk(396)/
176/ Label,
yHk(396) yH(k 396)yg Form yHkpHwGifyg0ifaom Toolbox Icon rsm;udkavhvmygu Text Box,
Command Button,
Data,
Frame wdy Yk g0ifNy;D
4if;wdkY\ Properties rsm;udk jyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif vdktyfaomy½dk*&rfrsm; a&;om;&rnfjzpfonf/ 177/
Label1 - Label Properties rSm (u) (Name) Label1 ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle Opaque ( i) BorderStyle1 - Fixed Single ( p) Caption uHprf;rnfhta&&twGuf (qkrJta&twGuf) (q) Font -Win---Kalaw, Bold, 18 ( Z) WordWrap False
uGefysLwmvufpJG 178/
342
Label2 - Label Properties rSm (u) (Name) Label2 ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle Opaque ( i) BorderStyle1 - Fixed Single ( p) Caption uHprf;rnfhta&&twGuf
(q) Font ( Z) WordWrap -
(uHprf;rnfhta&twGuf)
-Win---Kalaw, Bold, 18 False
179/
Label3 - Label Properties rSm (u) (Name) Label3 ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle Opaque ( i) BorderStyle1 - Fixed Single ( p) Caption qkrJeHygwf (qkrJeHygwf) (q) Font -Win---Kalaw, Bold, 18 ( Z) WordWrap False
180/
Label4 - Label Properties rSm (u) (Name) Label4 ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle Opaque ( i) BorderStyle1 - Fixed Single ( p) Caption uHxl;½SiftrSwf (uHxl;½SiftrSwf) (q) Font -Win---Kalaw, Bold, 18 ( Z) WordWrap False
181/
Label5 - Label Properties rSm (u) (Name) Label5 ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle Opaque ( i) BorderStyle1 - Fixed Single
343 ( p) Caption
-
(q) Font ( Z) WordWrap -
Microsoft Visual Basic 6.0
qkrJeHygwf tm; uHxl;½SiftrSwf rS &&½Sdygonf (qkre J yH gwf tm;uHx;l ½Sif
trSwf
rS &½Sdygonf)
-Win---Kalaw, Bold, 18 False
182/
Text1 - Text Properties rSm (u) (Name) Text1 ( c) Alignment 0 - Left Justify ( *) BorderStyle1 - Fixed Single (C) Font -Win---Kalaw, Bold, 18 ( i) Text Empty
183/
Text2 - Text Properties rSm (u) (Name) Text2 ( c) Alignment 0 - Left Justify ( *) BorderStyle1 - Fixed Single (C) Font -Win---Kalaw, Bold, 18 ( i) Text Empty
184/
Text3 - Text Properties rSm (u) (Name) Text3 ( c) Alignment 0 - Left Justify ( *) BorderStyle1 - Fixed Single (C) Font -Win---Kalaw, Bold, 18 ( i) Text Empty
185/
Text4 - Text Properties rSm (u) (Name) Text4 ( c) Alignment 0 - Left Justify ( *) BorderStyle1 - Fixed Single (C) Font -Win---Kalaw, Bold, 18 ( i) Text Empty
186/
Text5 - Text Properties rSm (qkre J yH gwf (u) (Name) Text5 ( c) Alignment 0 - Left Justify
tm;)
uGefysLwmvufpJG ( *) BorderStyle(C) Font ( i) Text 187/
344 1 - Fixed Single -Win---Kalaw, Bold, 18 Empty
Text6 - Text Properties rSm (uHxl;½SiftrSwf rS &½Sdygonf) (u) (Name) Text6 ( c) Alignment 0 - Left Justify ( *) BorderStyle1 - Fixed Single (C) Font -Win---Kalaw, Bold, 18 ( i) Text Empty
188/ Text7 - Text Properties rSm (uHprf;&ef Command Button atmuf0Suf xm;onf) (u) (Name) Text7 ( c) Alignment 0 - Left Justify ( *) BorderStyle1 - Fixed Single (C) Font -Win---Kalaw, Bold, 18 ( i) Text Empty 189/
Command1 - CommandButton Properties rSm(u) (Name) Command1 ( c) Caption uHprf;&&ef (uHprf;&ef) ( *) BorderStyle1 - Fixed Single (C) Font -Win---Yadanapon, Bold, 22
190/
Command2 - CommandButton Properties rSm(u) (Name) Command2 ( c) Caption y½dk*&&rfrSxGuf&&ef
( *) BorderStyle(C) Font 191/
(y½dk*&rfrSxGuf&ef)
1 - Fixed Single -Win---Innwa, Bold, 20
Command3 - CommandButton Properties rSm(u) (Name) Command3 ( c) Caption uHprf;&&ef (uHprf;rJtrnfpm&if;Munfh&ef) ( *) BorderStyle1 - Fixed Single (C) Font -Win---Innwa, Bold, 20
345 192/
Microsoft Visual Basic 6.0
Data1 - Data Properties (u) (Name) ( c) Align ( *) BOFAction (C) Caption ( i) Connect ( p) DatabaseName
rSm(rjrifap&efwpfckckatmuf0Sufxm;&rnf/)
(q) EOFAction ( Z) Font ( ps) RecordsetType
-
-
Data1 None 0 - Move First Data1 Access C:\Program Files\LuckyDraw \Lucky.mdb 0 - Move Last MS Sans Serif, Regular, 8 0 - Table
193/
Frame1 - Frame Properties rSm(u) (Name) Frame1 ( c) BorderStyle 1 - Fixed Single ( *) Caption Empty (C) Font MS Sans Serif, Regular, 8
194/
Frame2 - Frame Properties rSm(u) (Name) Frame2 ( c) BorderStyle 1 - Fixed Single ( *) Caption Empty (C) Font MS Sans Serif, Regular, 8
195/
Frame3 - Frame Properties rSm(u) (Name) Frame3 ( c) BorderStyle 1 - Fixed Single ( *) Caption Empty (C) Font MS Sans Serif, Regular, 8
196/
Frame4 - Frame Properties rSm(u) (Name) Frame4 ( c) BorderStyle 1 - Fixed Single ( *) Caption Empty (C) Font MS Sans Serif, Regular, 8
uGefysLwmvufpJG
346
197/
(General), (Declaration) twGufDim MyDb As Database, MyData As Recordset
198/
uHprf;&ef Command Button1 twGuf-
Private Sub Command1_Click() Dim MyDb As Database, MyData As Recordset Dim zaw As Boolean Dim a, b As Integer a = Val(Text1) b = Val(Text3) If Text1 <> Empty Then Text5 = b + 1 Text3 = b + 1 Text5 = Text3 If b + 1 >= a Then Text3 = b + 1 Text5 = b + 1 Text6 = 0 Command1.Visible = False Form2.Show End If Text5.ForeColor = "255" Else Form3.Show End If Text6.ForeColor = "0" '''''''' zaw = True Set MyDb = Workspaces(0).OpenDatabase("c:\Program Files\ LuckyDraw\Lucky.mdb") Set MyData = MyDb.OpenRecordset("Luck01", dbOpenTable) MyData.MoveFirst c = Text2 sn = Text3 en = 0 d = Int(Rnd() * c) + 1
347
Microsoft Visual Basic 6.0
Do While zaw = True MyData.Index = "Luckno" MyData.Seek "=", d If MyData.NoMatch Then zaw = False Else d = Int(Rnd() * c + 1) End If Loop Text6 = d Text4 = d MyData.AddNew MyData("Luckno") = Text6 MyData.Update Text6.ForeColor = "65535" Text7 = 0 Data1.Refresh End Sub
199/
y½dk*&rfrSxGuf&ef Command Button2 twGuf-
Private Sub Command2_Click() Unload Me End End Sub
200/
uHprf;rJtrnfpm&if;Munfh&ef Command Button3 twGuf-
Private Sub Command3_Click() Dim MyDb As Database, MyData As Recordset, MyDatapp As Recordset Dim ss As Integer Set MyDb = Workspaces(0).OpenDatabase("c:\Program Files\ LuckyDraw\Lucky.mdb") Set MyData = MyDb.OpenRecordset("Luck01", dbOpenTable) Set MyDatapp = MyDb.OpenRecordset("Luck02", dbOpenTable) If MyDatapp.RecordCount > 0 Then MyDatapp.MoveFirst Do While MyDatapp.EOF = False
uGefysLwmvufpJG
348
MyDatapp.Delete MyDatapp.MoveNext Loop End If MyData.MoveFirst ss = 0 Do While MyData.EOF = False yy = MyData("Luckno") If yy < 9999 And yy <> 0 Then MyDatapp.AddNew MyDatapp("Luckno") = yy MyDatapp("srno") = ss MyDatapp.Update End If MyData.MoveNext ss = ss + 1 Loop MyDatapp.MoveFirst Form5.Show End Sub
201/
Data1 Reposition twGufPrivate Sub Data1_Reposition() Data1.Caption = "Record: " & (Data1.Recordset.AbsolutePosition + 1) End Sub
202/
Form Load twGufPrivate Sub Form_Load() Set MyDb = Workspaces(0).OpenDatabase("C:\Program Files\ LuckyDraw\Lucky.mdb") Set MyData = MyDb.OpenRecordset("Luck01", dbOpenTable) MyData.AddNew MyData("Luckno") = 0 MyData.Update Data1.Refresh End Sub
349
Microsoft Visual Basic 6.0
203/
Form Unload twGuf Private Sub Form_Unload(Cancel As Integer) Set MyDb = Workspaces(0).OpenDatabase("c:\Program Files\ LuckyDraw\Lucky.mdb") Set MyData = MyDb.OpenRecordset("Luck01", dbOpenTable) MyData.MoveFirst Do Until MyData.EOF MyData.Delete MyData.MoveNext Loop Data1.Refresh End Sub
204/
Lucky Draw Program BuD;udk Run í&Edkifap&ef yHk(397)wGifyg0ifaom Form File rsm;udkwnfaqmuf&ayrnf/
yHk(397)
uGefysLwmvufpJG 205/
350
qufvufí Form2 udkwnfaqmuf&ayrnf/ yHk(398)/
yHk(398)
206/ Label,
yH(k 398)yg Form yHkpHwGifyg0ifaom Toolbox Icon rsm;udkavhvmygu Command Button,
Frame wdkYyg0ifNyD; 4if;wdkY\ Properties rsm;udk
jyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif vdktyfaomy½dk*&rfrsm; a&;om; &rnfjzpfonf/ 207/
Label1 - Label Properties rSm (u) (Name) Label1 ( c) Alignment 2 - Center ( *) AutoSize False (C) BackStyle Opaque ( i) BorderStyle0 - None ( p) Caption uHprf;rJukefaeygNyD (uHprf;rJukefaeygNyD) (q) Font -Win---Taungyi, Bold, 26 ( Z) WordWrap False
208/
Frame1 - Frame Properties rSm(u) (Name) Frame1 ( c) BorderStyle1 - Fixed Single ( *) Caption Empty (C) Font MS Sans Serif, Regular, 8
351
Microsoft Visual Basic 6.0
209/
Command1 - CommandButton Properties rSm(u) (Name) Command1 ( c) Caption ydwf&&ef (ydwf&ef) ( *) BorderStyle1 - Fixed Single (C) Font -Win---Yadanapon, Bold, 28
210/
ydwf&ef Command Button1 twGuf-
Private Sub Command1_Click() Form2.Hide Unload Form2 End Sub
211/
qufvufí Form3 udkwnfaqmuf&ayrnf/ yHk(399)/
yHk(399)
212/
yH(k 399)yg Form yHkpHwGifyg0ifaom Toolbox Icon rsm;udkavhvmygu Label,
Command Button,
Frame wdkYyg0ifNyD; 4if;wdkY\ Properties
rsm;udk jyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif vdktyfaomy½dk*&rfrsm; a&;om;&rnfjzpfonf/ 213/
Label1 - Label Properties rSm (u) (Name) Label1 ( c) Alignment 2 - Center ( *) AutoSize False (C) BackStyle Opaque ( i) BorderStyle0 - None
352
uGefysLwmvufpJG ( p) Caption
-
(q) Font ( Z) WordWrap -
uHprf;rJta&&twGufxnfhyg
(uHprf;rJta&twGufxnfh&ef) -Win---Taungyi, Bold, 24 False
214/
Frame1 - Frame Properties rSm(u) (Name) Frame1 ( c) BorderStyle1 - Fixed Single ( *) Caption Empty (C) Font MS Sans Serif, Regular, 8
215/
Command1 - CommandButton Properties rSm(u) (Name) Command1 ( c) Caption ydwf&&ef (ydwf&ef) ( *) BorderStyle1 - Fixed Single (C) Font -Win---Yadanapon, Bold, 28
216/
ydwf&ef Command Button1 twGuf-
Private Sub Command1_Click() Form3.Hide Unload Form3 Form1.Show End Sub
217/
qufvufí Form4 udkwnfaqmuf&ayrnf/ yHk(400)/
yHk(400)
353 218/ Label,
Microsoft Visual Basic 6.0
yH(k 400)yg Form yHkpHwGifyg0ifaom Toolbox Icon rsm;udkavhvmygu Command Button,
Frame wdkYyg0ifNyD; 4if;wdkY\ Properties rsm;udk
jyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif vdktyfaomy½dk*&rfrsm; a&;om; &rnfjzpfonf/ 219/
Label1 - Label Properties rSm (u) (Name) Label1 ( c) Alignment 2 - Center ( *) AutoSize False (C) BackStyle Opaque ( i) BorderStyle0 - None ( p) Caption qkrJwpfcktwGufwpfBudrfomESdyfyg
(q) Font ( Z) WordWrap -
(qkrJwpfcktwGufwpfBudrfomESdyfyg) -Win---Kalaw, Bold, 22 False
220/
Frame1 - Frame Properties rSm(u) (Name) Frame1 ( c) BorderStyle1 - Fixed Single ( *) Caption Empty (C) Font MS Sans Serif, Regular, 8
221/
Command1 - CommandButton Properties rSm(u) (Name) Command1 ( c) Caption ydwf&&ef (ydwf&ef) ( *) BorderStyle1 - Fixed Single (C) Font -Win---Yadanapon, Bold, 28
222/
ydwf&ef Command Button1 twGuf-
Private Sub Command1_Click() Form4.Hide Unload Form4 End Sub
uGefysLwmvufpJG 223/
354
qufvufí Form5 udkwnfaqmuf&ayrnf/ yHk(401)/
yHk(401)
224/
yH(k 401)yg Form yHkpHwGifyg0ifaom Toolbox Icon rsm;udkavhvmygu DBGrid, Data, Command ButtonwdkYyg0ifNyD; 4if;wdkY\ Properties rsm;udk jyifqifjznfph u G Nf y;D aemuf Command Button wGif vdt k yfaomy½d*k &rfrsm; a&;om;&rnf jzpfonf/ 225/
DBGrid1 - DBGrid Properties rSm (u) (Name) DBGrid1 ( c) Align 0 - vbAlignNone ( *) AllowAddNew False (C) AllowArrows True ( i) AllowDelete False ( p) AllowUpdate True
355 (q) ( Z) ( ps) (n) ( #) 226/
BorderStyle Caption DataMode DataSource Font
-
Data1 - Data Properties (u) (Name) ( c) Align ( *) BOFAction (C) Connect ( i) DatabaseFile
rSm-
( p) (q) ( Z) ( ps)
-
EOFAction Font RecordsetType RecordsetSource
-
Microsoft Visual Basic 6.0 1 - Fixed Single None 0 - Bound Data1 MS Sans Serif, Regular, 8 Data1 0 - None 0 - Move First Access C:\Program Files\LuckyDraw \Lucky.mdb 0 - Move Last MS Sans Serif, Regular, 8 1 - Dynaset Luck02
227/
Command1 - CommandButton Properties rSm(u) (Name) Command1 ( c) Caption ydwf&&ef (ydwf&ef) ( *) BorderStyle 1 - Fixed Single (C) Font -Win---Yadanapon, Bold, 20
228/
ydwf&ef Command Button1 twGuf-
Private Sub Command1_Click() Unload Me End Sub
229/
Data1 Reposition twGufPrivate Sub Data1_Reposition() Data1.Caption = " Record: " & (Data1.Recordset.AbsolutePosition + 1) End Sub
230/
tqdyk g y½d*k &rfukd Run ygu yHk(402)ygtwdkif;jrifawGU&rnf/
uGefysLwmvufpJG
356
yHk(402) 231/ Oyrm - qkrt J a&twGuf 6 ckom½SNd y;D ? uHprf;rnft h a&twGurf mS 125 OD;½Syd gu qkrJta&twGufnmzuf½Sd tqdkyg y½dk*&rfudk Run ygu yH(k 402)ygtwdik ;f jrifawGU&rnf/ qkrJta&twGuf 6 ck½Sdojzifh uHprf;&ef Command Button tm; 6 cgESdyfNyD;ygu uHprf;rJukefaeygNyD[laom Message Box jyvmrnf/ yH(k 403)/
yHk(403)
232/
tqdyk g Message Box tm; ydwf&ef Command Button udEk ydS yf gu Message Box aysmufomG ;Ny;D ? uHprf;&ef Command Button ygaysmufomG ;vdrr hf nf/ yH(k 404)/
357
Microsoft Visual Basic 6.0
yHk(404) 233/ uHprf;rJtrnfpm&if;Munf&h ef Command Button udEk ydS yf gu yH(k 405)ygtwdik ;f jrifawGU&rnf/
yHk(405)
234/ txufyg Form yHkpHwGif ydwf&ef Command Button udka½G;cs,fygu rlv uHprf;rJEdIufonfh Form yHkpHodkYjyefvnfa&muf½SdoGm;NyD;? y½dk*&rfrSxGuf&ef Command Button udE k ydS yf gu tqdyk g Form yHpk rH x S u G o f mG ;vdrrhf nf/ ---------------0-0-0---------------
uGefysLwmvufpJG
358
ODBC jzifhzefwD;xm;aom Access zdkifudktouf? vkyfouf? yifpif,lrnfhESpfwGufjcif; 235/ Access 2000 (or) Access 2002 wdjYk zifh Database File wpfcu k w kd nfaqmuf xm;&rnf/ 4if; Database File rS Table File wGifatmufygZ,m;twdkif;wnfaqmuf xm;NyD; Record rsm;xnfhxm;&rnfField Name IDNo Name Date of Birth Enrollment Age Services Year Retire Year
Data Type Text Text Date Date Number Number Date
Field Size 8 30
Double, Fixed, Decimal 2 Double, Fixed, Decimal 2
236/ Oyrm - Retire [k Database File, Table File wdw Yk iG t f rnfay;xm;yg/ xdkYaemuf 4if;zdkifudk ODBC \vkyfydkifcGifhodkYajymif;vJNyD; Microsoft Visual Basic 6.0 jzifh atmufazmfjyyg Form yHkpHudkwnfaqmufxm;&rnf/
yHk(406) 237/ yH(k 406)yg Form yHpk w H iG f , , rsm;jzifh zefwD;xm;NyD; oufqdkif&m Properties rsm;wGifjyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif vdktyfaomy½dk*&rfrsm;a&;om;&ef jzpfygonf/ 238/
Adodc1 - Adodc Properties twGuf (u) (Name) Adodc1 ( c) Align 0 - vbAlignNone
359 ( *) BOFAction (C) ConnectingString ( i) EOFAction ( p) Font (q) RecordSource
239/
-
Microsoft Visual Basic 6.0 0 - adDoMoveFirst provider=msdasql;dsn= retire; uid=;pwd=; 0 - adDoMoveLast MS Sans Serif, Bold, 8 select [IDNo], Name, [Date of Birth], [Enrollment], Age, [Services Year], [Retire Year] from retire order by [IDNo]
DataGrid1 - DataGrid Properties twGuf (u) (Name) DataGrid1 ( c) Align 0 - vbAlignNone ( *) AllowAddNew False (C) AllowArrows True ( i) AllowDelete False ( p) AllowUpdate True (q) Font MS Sans Serif, Regular, 8 ( Z) DataSource Adodc1
240/
Adodc1 - Adodc \ Record Position twGuf Private Sub a1_MoveComplete(ByVal adReason As ADODB.EventReason Enum, ByVal pError As ADODB.Error, adStatus As ADODB.Event StatusEnum, ByVal pRecordset As ADODB.Recordset) Adodc1.Caption = "Record: " & CStr(Adodc1.Recordset.AbsolutePosition)
End Sub
241/
Age Command Button twGuf Private Sub Command1_Click() Adodc1.Recordset.MoveFirst Do While Adodc1.Recordset.EOF = False x = (Date - Adodc1.Recordset("Date of Birth")) / 365.25 Adodc1.Recordset("Age") = x Adodc1.Recordset.MoveNext Loop Adodc1.Recordset.MoveFirst End Sub
uGefysLwmvufpJG
360
242/
Services Command Button twGuf Private Sub Command2_Click() Adodc1.Recordset.MoveFirst Do While Adodc1.Recordset.EOF = False y = (Date - Adodc1.Recordset("Enrollment")) / 365.25 Adodc1.Recordset("Services Year") = y Adodc1.Recordset.MoveNext Loop Adodc1.Recordset.MoveFirst End Sub
243/
Retire Year Command Button twGuf Private Sub Command3_Click() Adodc1.Recordset.MoveFirst Do While Adodc1.Recordset.EOF = False mdy = Adodc1.Recordset("Date of Birth") myear = Year(mdy) + 60 mmth = Month(mdy) mday = Day(mdy) zzz = mday & "-" & mmth & "-" & myear Adodc1.Recordset("Retire Year") = zzz Adodc1.Recordset.MoveNext Loop Adodc1.Recordset.MoveFirst End Sub
244/
Exit Command Button twGuf Private Sub Command4_Click() Unload Me End End Sub
245/
tqdyk gy½d*k &rfukd Run yguyHk(406)ygtwdkif;jrifawGU&rnf/ Age Command Button udkESdyfygu toufrsm;wGufcsufay;rnfjzpfNyD;? Services Year Command Button udk ESdyfygu trIxrf;oufrsm;wGufcsufay;vdrfhrnf/ Retire Year Comamand Button udk ESdyfygu yifpif,lrnfh &uf? v? ckESpfwdkYudkwGufcsufay;vdrfhrnf/ yHk(407)/
361
Microsoft Visual Basic 6.0
yHk(406)
yHk(407)
---------------0-0-0---------------
362
uGefysLwmvufpJG
Visual Basic 6.0 jzifhzefwD;xm;aom Access zdkifudk Printer jzifh½dkufxkwfjcif; 246/ Visual Basic 6.0 jzifhyif Database File wpfckudkwnfaqmufxm;&rnf/ 4if; Database File rS Table File wGifatmufazmfjyygZ,m;twdkif;wnfaqmufxm;NyD; Record rsm;xnfx h m;&rnf/ Field Name
Data Type
Field Size
IDNo Name Date of Birth Enrollment Age Services Year Retire Year
Text Text Date Date Double Double Date
8 25
247/ Oyrm - Retired [k Database File, Table File wdw Yk iG t f rnfay;xm;yg/ xdkYaemuf Microsoft Visual Basic 6.0 jzifh atmufazmfjyyg Form yHkpHudkwnfaqmuf xm;&rnf/
yHk(408)
248/
yH(k 408)yg Form yHpk w H iG f rsm;jzifh zefw;D xm;Ny;D oufqikd &f m Properties rsm;wGifjyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif vdktyfaom y½dk*&rfrsm;a&;om;&ef jzpfygonf/
363
Microsoft Visual Basic 6.0
249/
Report Command Button twGufPrivate Sub Command1_Click() Command3.Visible = True Command4.Visible = True End Sub
250/
Exit Command Button twGufPrivate Sub Command2_Click() Command3.Visible = False Command4.Visible = False Unload Me End End Sub
251/
Soft Copy Command Button twGufPrivate Sub Command3_Click() Form3.Show End Sub
252/
Hard Copy Command Button twGufPrivate Sub Command4_Click() Form2.Show End Sub
253/
Form Load twGufPrivate Sub Form_Load() Command3.Visible = False Command4.Visible = False End Sub
254/ Soft Copy Command Button udka½G;cs,fygu Form2.Show [ky½dk*&rf a&;om;xm;ojzifh Form2 udkyHk(409)ygtwdkif;zefwD;wnfaqmuf&rnf/
uGefysLwmvufpJG
364
yHk(409) 255/ yH(k 409)yg Form yHkpHwGifyg0ifaom Toolbox Icon rsm;udkavhvmygu DBGrid, Label, Text Box, Data, Command Buttonwdy Yk g0ifNy;D 4if;wdkY\ Properties rsm;udk jyifqifjznfhpGufNyD;aemuf Command Button wGif vdktyf aomy½dk*&rfrsm;a&;om;&rnfjzpfonf/ 256/
DBGrid1 - DBGrid Properties rSm (u) (Name) DBGrid1 ( c) Align 0 - vbAlignNone ( *) AllowAddNew False (C) AllowArrows True ( i) AllowDelete False ( p) AllowUpdate True (q) BorderStyle 1 - Fixed Single ( Z) Caption None ( ps) DataMode 0 - Bound (n) DataSource Data1 ( #) Font MS Sans Serif, Regular, 8
257/
Label1 - Label Properties rSm(u) (Name) Label1 ( c) Alignment 0 - Left Justify ( *) AutoSize False
365 (C) ( i) ( p) (q) 258/
259/
BackStyle BorderStyle Caption Font
-
Text1 - Text Properties rSm(u) (Name) ( c) Alignment ( *) BorderStyle (C) Font ( i) Text Data1 - Data Properties (u) (Name) ( c) Align ( *) BOFAction (C) Connect ( i) DatabaseFile
rSm-
( p) (q) ( Z) ( ps)
-
EOFAction Font RecordsetType RecordsetSource
-
Microsoft Visual Basic 6.0 0 - Transparent 1 - Fixed Single All Records MS Sans Serif, Bold, 8 Text1 0 - Left Justify 1 - Fixed Single MS Sans Serif, Bold, 8 Empty Data1 0 - None 0 - Move First Access C:\Program Files\Microsoft Visual Studio\VB98\Retired.mdb 0 - Move Last MS Sans Serif, Regular, 8 1 - Dynaset Retired
260/
Command1 - CommandButton Properties rSm(u) (Name) Command1 ( c) Caption To Calculate Age ( *) Font MS Sans Serif, Regular, 8
261/
Command2 - CommandButton Properties rSm(u) (Name) Command2 ( c) Caption To Calculate Services Year ( *) Font MS Sans Serif, Regular, 8
262/
Command3 - CommandButton Properties rSm(u) (Name) Command3 ( c) Caption To Calculate Retire Year
366
uGefysLwmvufpJG ( *) Font 263/
-
MS Sans Serif, Regular, 8
Command4 - CommandButton Properties rSm(u) (Name) - Command4 ( c) Caption - &Return to Main Menu ( *) Font - MS Sans Serif, Regular, 8
264/
To Calculate Age Command Button1 twGufPrivate Sub Command1_Click() Set MyDb = Workspaces(0).OpenDatabase("Retired.mdb") Set MyData = MyDb.OpenRecordset("Retired", dbOpenTable) MyData.MoveFirst Do While MyData.EOF = False MyData.Edit x = (Date - MyData("Date of Birth")) / 365.25 MyData("Age") = x MyData.Update MyData.MoveNext Loop MyData.MoveFirst End Sub
265/
To Calculate Services Year Command Button2 twGufPrivate Sub Command2_Click() Set MyDb = Workspaces(0).OpenDatabase("Retired.mdb") Set MyData = MyDb.OpenRecordset("Retired", dbOpenTable) MyData.MoveFirst Do While MyData.EOF = False MyData.Edit y = (Date - MyData("Enrollment")) / 365.25 MyData("Services Year") = y MyData.Update MyData.MoveNext Loop MyData.MoveFirst End Sub
367
Microsoft Visual Basic 6.0
266/
To Calculate Retire Year Command Button3 twGufPrivate Sub Command3_Click() Set MyDb = Workspaces(0).OpenDatabase("Retired.mdb") Set MyData = MyDb.OpenRecordset("Retired", dbOpenTable) MyData.MoveFirst Do While MyData.EOF = False MyData.Edit mdy = MyData("Date of Birth") myear = Year(mdy) + 60 mmth = Month(mdy) mday = Day(mdy) zzz = mday & "-" & mmth & "-" & myear MyData("Retire Year") = zzz MyData.Update MyData.MoveNext Loop MyData.MoveFirst End Sub
267/
Return to Main Menu Command Button4 twGufPrivate Sub Command4_Click() Unload Me End Sub
268/
Data1 Reposition twGufPrivate Sub Data1_Reposition() Data1.Caption = " Record: " & (Data1.Recordset.AbsolutePosition + 1) End Sub
269/
Form Load twGufPrivate Sub Form_Load() Set MyDb = Workspaces(0).OpenDatabase("Retired.mdb") Set MyData = MyDb.OpenRecordset("Retired", dbOpenTable) MyData.MoveLast Text1.Text = MyData.RecordCount End Sub
uGefysLwmvufpJG
368
270/
tqdyk gy½d*k &rfukd Run ygu yHk(410)ygtwdkif;jrifawGU&rnf/ To Calculate Age Command Button udkESdyfygutoufrsm;wGufcsufay;rnfjzpfNyD;? To Calculate Services Year Command Button udkESdyfygu trIxrf;oufrsm;wGufcsufay;vdrfhrnf/ To Calculate Retire Year Comamand Button udkESdyfyguyifpif,lrnfh &uf? v? ckESpfwdkYudkwGufcsufay;vdrfhrnf/
yHk(410)
369
Microsoft Visual Basic 6.0
271/ Hard Copy Command Button udka½G;cs,fygu Form3.Show [ky½dk*&rf a&;om;xm;ojzifh Form3 udkyHk(411)ygtwdkif;zefwD;wnfaqmuf&rnf/
yHk(411)
272/
yH(k 411)yg Form yHkpHwGifyg0ifaom Toolbox Icon rsm;udkavhvmygu Label, Crstal Report, Combo Box, Command ButtonwdkYyg0ifNyD; 4if;wdkY\ Properties rsm;udk jyifqifjznfhpGufNyD;aemuf Command Button wGif vdktyf aomy½dk*&rfrsm;a&;om;&rnf jzpfonf/ 273/
Combo1 - ComboBox Properties rSm(u) (Name) Combo1 ( c) Font MS Sans Serif, Regular, 8 ( *) ItemData (List) 0 ^ Enter jzifh½dkuf&ef 0 (C) List [List] Window ^ Enter jzifh½dkuf&ef Printer ( i) Style 0 - DropdownCombo ( p) Text Window
274/
Label1 - Label Properties rSm(u) (Name) Label1 ( c) Alignment 2 - Center
370
uGefysLwmvufpJG ( *) (C) ( i) ( p) (q)
AutoSize BackStyle BorderStyleCaption Font -
False 0 - Transparent 0 - None Using Crystal Report MS Sans Serif, Bold, 14
275/
Label2 - Label Properties rSm(u) (Name) Label2 ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle 0 - Transparent ( i) BorderStyle0 - None ( p) Caption Print Destination (q) Font MS Sans Serif, Bold, 10
276/
Label3 - Label Properties rSm(u) (Name) Label3 ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle 0 - Transparent ( i) BorderStyle0 - None ( p) Caption Identification Number From (q) Font MS Sans Serif, Bold, 10
277/
Label4 - Label Properties rSm(u) (Name) Label4 ( c) Alignment 0 - Left Justify ( *) AutoSize False (C) BackStyle 0 - Transparent ( i) BorderStyle0 - None ( p) Caption To (q) Font MS Sans Serif, Bold, 10
278/
Report1 - Crystal Report Properties rSm(u) (Name) Report1 ( c) Destination 0 - crptToWindow ( *) PrintFileType0 - crptRecord
371 (C) RecordSource( i) WindowState-
Microsoft Visual Basic 6.0
0 - crptReport 0 - crptNormal
279/
Text1 - Text Properties rSm(u) (Name) Text1 ( c) Alignment 0 - Left Justify ( *) BorderStyle1 - Fixed Single (C) Font MS Sans Serif, Regular, 8 ( i) Text A-00001
280/
Text2 - Text Properties rSm(u) (Name) Text2 ( c) Alignment 0 - Left Justify ( *) BorderStyle1 - Fixed Single (C) Font MS Sans Serif, Regular, 8 ( i) Text A-99999
281/
Combo Box a½G;cs,f&eftwGufPrivate Sub Combo1_Click() If Combo1.Text = "Printer" Then Form4.Show End If End Sub
282/
Print Report Command Button twGufPrivate Sub Command1_Click() If Combo1.Text = "Window" Then rpt1 = 0 Else Combo1.Text = "Printer" rpt1 = 1 Report1.CopiesToPrinter = num1 End If pt1 = "{Retired.IDNo} in '" + Trim(Text1.Text) + "' to '" + Trim(Text2.Text) + "'" Report1.SelectionFormula = pt1 Report1.Destination = rpt1
uGefysLwmvufpJG
372
a1 = LCase(App.Path) If Right(App.Path, 1) <> "\" Then a1 = a1 + "\" 'Handles the root Report1.DataFiles(0) = a1 + "Retired.mdb" Report1.ReportFileName = a1 + "Retired.rpt" Report1.Action = 1 End Sub
283/
tqdyk gy½d*k &rfukd Run ygu yHk(412)ygtwdkif;jrifawGU&rnf/ Print Destination nmzuf½Sd Combo Box Dropdown Arrow udka½G;cs,fygu Window ESifh Printer [l íjrifawGU&NyD; rdrdtvdk½Sd&mudka½G;cs,fEdkifygonf/ Identification Number From \nmzuf Text Box wGif Record Identification Number rdrdpvdkonfh eHygwfrSp&efjzpfNyD; To \nmzuf Text Box ü rdrdtqHk;owf½dkufESdyfvdkonfh Record Identification Number udkjyifqifjznfhpGuf&efjzpfonf/ Print Report Command Button udE k ydS yf gu Combo Box udk Window a½G;cs,fcJhygu Printer jzifh½dkufESdyf&ef Print Preview udk jyrnfjzpfNy;D Printer udak ½G;cs,c f yhJ gu wdu k ½f u kd Printer f jzifh ½du k Ef ydS rf nf jzpfygonf/
yHk(412)
373
Microsoft Visual Basic 6.0
284/ Combo Box wGif Printer uda k ½G;cs,yf gu Form4.Show [ky½d*k &rfa&;om; xm;jzifh Form4 udkyHk(413)ygtwdkif;zefwD;wnfaqmuf&rnf/
yHk(413)
285/
yH(k 413)yg Form yHkpHwGifyg0ifaom Toolbox Icon rsm;udkavhvmygu Label, Text Box, Command ButtonwdkYyg0ifNyD; 4if;wdkY\ Properties rsm;udk jyifqif jznfph u G Nf y;D aemuf Command Button wGif vdt k yfaomy½d*k &rfrsm; a&;om;&rnf jzpfonf/ 286/
Label1 - Label Properties rSm(u) (Name) Label1 ( c) Alignment 0 - Left Justify ( *) BackStyle 0 - Transparant (C) BorderStyle0 - None ( i) Caption Please enter the number of copies ( p) Font MS Sans Serif, Bold, 10
287/
Label2 - Label Properties rSm (u) (Name) Label2 ( c) Alignment 0 - Left Justify ( *) BackStyle 0 - Transparant (C) BorderStyle0 - None ( i) Caption you wish to print ( p) Font MS Sans Serif, Bold, 10
uGefysLwmvufpJG
374
288/
Text1 - TextBox Properties rSm(u) (Name) Text1 ( c) Alignment 0 - Left Justify ( *) BorderStyle1 - Fixed Single (C) Font MS Sans Serif, Bold, 10 ( i) Text 1
289/
Command1 - CommandButton Properties rSm(u) (Name) Command1 ( c) Caption Accept Number of Copies ( *) Font MS Sans Serif, Bold, 10
290/
Command2 - CommandButton Properties rSm(u) (Name) Command2 ( c) Caption Reset Number of Copies ( *) Font MS Sans Serif, Bold, 10
291/
Command1 twGufPrivate Sub Command1_Click() num1 = Text1 Form4.Hide End Sub
292/
Command2 twGufPrivate Sub Command2_Click() Text1.Text = "1" End Sub
---------------0-0-0---------------
375
Microsoft Visual Basic 6.0
Chapter (11) Visual Basic 6.0 jzifh Program wpfcktm;a&;NyD; Execute File wnfaqmufjcif; 293/ yxrtqifhtaejzifh Microsoft Visual Basic 6.0 jzifh Program wpfyk'f a&;om;yg/ Oyrm - vuf½SdESpf-v-&uf-em&D-rdepf-puúefYudkjyaom Program wpfyk'fudk a&;om;xm;&rnf/ zdkif\y½dk*&rftrnfudk extest017.vbp [ktrnfowfrSwfxm;NyD; Form File udk extest017 .frm [ktrnfowfrw S yf g/ yH(k 414)/
yHk(414)
294/
txufygzdik u f kd Execute File vkyrf nfqykd gu Menu Bar ½Sd File udak ½G;yg/ Pull Down Menu usvmygu 4if;xJrS Make extest017.exe... udka½G;cs,f&rnf/ yH(k 415)/
uGefysLwmvufpJG
376
yHk(415)
yHk(416)
377
Microsoft Visual Basic 6.0
295/ xdktcg Make Project Dialog Box ay:vmrnf/ rdrdodrf;vdkonfhvrf; aMumif;? rdro d rd ;f vdo k nfh zdik t f rnfukd jyKjyifjznfph u G í f Execute File udw k nfaqmufEikd f ayonf/ yHk(417)? yHk(418)/
yHk(417)
yHk(418)
uGefysLwmvufpJG
378
296/ xdt k cgrdrt d rnfay;vdu k o f nft h wdik ;f c:\Example001.exe jzpfomG ;ayrnf/ 4if;zdkifudk Run vdyk gu Computer Desktop wGif½Sdaeaom My Computer Short Cut Icon udk Double Click (or) Active jzpfaeaomtcg Enter ESy d yf g/ yH(k 419)/
yHk(419)
297/ xdt k cgyH(k 420)wGiaf zmfjyxm;onft h wdik ;f [C:]udkDouble Click (or) Active jzpfaeaomtcg Enter ESyd yf g/
yHk(420)
379
Microsoft Visual Basic 6.0
yHk(421)
298/
yH(k 421)wGijf rifawGUae&aom Example001.exe zdkifudk Run vdyk gu Double Click (or) Active jzpfaeaomtcg Enter ESy d yf g/
yHk(422)
uGefysLwmvufpJG
380
299/
yHk(422)wGifjrifawGUae&aom Date and Time Testing Form tm; Command Button wpfckjzpfaom Run udka½G;cs,fygu yHk(423)ygtwdkif; &ufpJG? tcsdefrsm; azmfjyrnf/ 4if;y½dk*&rfrSxGufvdkygu Close Button udka½G;cs,f&rnf/
yHk(423)
Execute File jyKvkyfí&onfhtwGuf Start → Run → c:\Example001 (or) c:\Example001.exe → OK udka½G;cs,fjcif;jzifhvnf;aumif;? Start → Run → command → OK udka½G;cs,fNyD; DOS Prompt rS C:\>Example001 (or) Example001.exe → Enter uddkESdyfjcif;jzifhvnf;aumif; y½dk*&rfudk Run Edkifayonf/ Visual Basic 6.0 Language r½Sdaomtjcm;pufrsm;odkYul;,lNyD;vnf; Run Edkifayonf/
300/
---------------0-0-0---------------
381
Microsoft Visual Basic 6.0
Visual Basic 6.0 jzifh Program wpfcktm;a&;NyD; Package jyKvkyfjcif; 301/ yxrtqift h aejzifh Microsoft Visual Basic 6.0 jzifh Program wpfy'k af &; om;yg/ Oyrm - Database File wpfzdkifwnfaqmufNyD; Record tenf;i,foGif;xm; &rnf/ tqdyk g Database File wGif½Sd Record tcsKUd udk wGucf suaf y;onfh y½d*k &rfwpfy'k f tm;a&;om;xm; &rnf/ zdik \ f y½d*k &rftrnfukd extest111.vbp [ktrnfowfrw S x f m;Ny;D Form File udk extest111 .frm [ktrnfowfrw S yf g/ yH(k 424)/
yHk(424) 302/ txufygzdik u f kd Application Package vkyrf nfqykd gu Menu Bar ½Sd AddIns uda k ½G;yg/ Pull Down Menu usvmygu 4if;xJrS Package and Deployment Wizard... udka½G;cs,f&rnf/ yHk(425)/
yHk(425)
uGefysLwmvufpJG
382
303/ xdt k cg Package and Deployment Wizard Dialog Box ay:vmrnf/ yHk(426)? Package rjyKvkyfrDtqdkyg Project File udo k rd ;f vdyk gu Yes udka½G;&efjzpfNyD;? rodr;f vdk ygu No udka½G;cs,f&rnf/ yHk(426)/ Oyrm - No udak ½G;yg/
yHk(426) 304/
Package and Deployment Wizard Dialog Box ay:vmrnf/ 4if; Dialog Box wGif rdrd Package vkyfvdkonfh Visual Basic Project File \ wnfae&mudk jyaernfjzpfNyD; Package Command Button udka½G;cs,f&rnf/ yHk(427)/
yHk(427)
305/
xdkaemuf Compile Command Button udka½G;cs,f&rnf/ xdktcgrSom Execute File &½Sdayrnf/ yHk(428)/
383
Microsoft Visual Basic 6.0
yHk(428)
306/
Compile vkyNf y;D oGm;ygu yH(k 429)yg Dialog Box ay:vmygu Yes Command Button udka½G;cs,fyg/
yHk(429) 307/ Package trsK;d tpm;a½G;cs,o f nfh Dialog Box ay:vmrnf/ Package Type udk Standard Setup Package ae&mwGifyifxm;í Next udak ½G;cs,yf g/ yH(k 430)/
yHk(430) 308/
Package udkrdrdxnfhvdkonfhvrf;aMumif;üxnfh&eftcGifhta&;&½Sdrnfh Dia-
log Box ay:vmrnf/ yH(k 431)/
uGefysLwmvufpJG
384
yHk(430)
yHk(431) 309/
tqdyk g Dialog Box wGiyf if Folder udkajymif;í Next udak ½G;cs,yf g/ yH(k 432)/
yHk(432) 310/ DAO Driver rsm;udka½G;cs,f&eftajctaeay;onfh Dialog Box ay:vm ygu zdkiftm;vHk;udka½G;cs,fNyD; Next udk Click ESyd &f rnf/ yH(k 433)/
385
Microsoft Visual Basic 6.0
yHk(433) 311/ Folder vrf;aMumif;topfa½G;cs,o f jzifh aysmufaeonfh *.dll zdik rf sm;pm&if;udk jyaevdrfhrnf/ rnfodkYyifjzpfap OK udk Click ESyd &f rnfjzpfonf/ yH(k 434)/
yHk(434)
312/ Out-of-Date Dependency Information Dialog Box xyfrHay:vmrnf/ OK udo k m Click ESyd &f rnfjzpfonf/ yH(k 435)/
uGefysLwmvufpJG
386
yHk(435)
313/
rdrdwnfaqmufrnfh Application Package wGif yg0ifonfh *.dll zdkifrsm;udk Check Box jzifh Mark vkyfxm;onf/ ra½G;cs,fvdkygu Uncheck jyKvkyfEdkifonf/ tm;vHk;a½G;cs,fxm;ojzifh Next Command Button udo k ma½G;cs,yf g/ yH(k 436)/
yHk(436) 314/ Cab File wnfaqmuf&eftcGifhta&;ay;onfh Dialog Box wpfckay:vm rnf/ tqdyk g Dialog Box wGif Single cab File wnfaqmufygu cab File wpfzikd w f nf; omwnfaqmufNyD; Disk Space rsm;vdrfhrnf/ Multiple cabs Option Button udk a½G;cs,fygu rdrdwnfaqmufvdkonfh cab size udk 1.44 MB, 2.88 MB, 1.2 Mb, 720KB ponfjzifha½G;cs,fwnfaqmufEdkifayonf/ Oyrm - 1.44 MB udka½G;cs,fygu
387
Microsoft Visual Basic 6.0
jzpfay:vmaom cab File rsm;onf 1.44 MB xufrausmfapbJ cab File rsm;wpfzdkif xufrujzpfvmayrnf/ tqdkyg Dialog Box wGif Multiple cabs Option Button udka½G;cs,fyg/ xdkYaemuf Cab size udk 1.44 MB wGifxm;NyD; Next Command Button udka½G;cs,f&efjzpfonf/ yHk(437)/
yHk(437)
315/
Installation Title udkowfrSwf&ef Dialog Box xyfrHay:vmrnf/ Installation title tm;rdrp d w d Bf uKu d o f wfrw S yf g/ Oyrm - Result of the Students [kjyifqif jznfhpGufí Next udka½G;cs,f&rnf/ yHk(438)/
yHk(438) 316/ Package and Deployment Wizard - Start Menu Items Dialog Box ay:vmrnf/ Next udak ½G;cs,yf g/ yH(k 439)/
uGefysLwmvufpJG
388
yHk(439)
317/ Package and Deployment Wizard - Install Locations Dialog Box ay:vmrnf/ Next udak ½G;cs,yf g/ yH(k 440)/
yHk(440) 318/ Package and Deployment Wizard - Shared Files Dialog Box ay:vm rnf/ Shared Files rsm;udk Check jyKvkyfí Next udak ½G;cs,yf g/ yH(k 441)/
389
Microsoft Visual Basic 6.0
yHk(441) 319/ Package and Deployment Wizard - Finished! Dialog Box ay:vm rnf/ Finish udak ½G;cs,yf g/ yH(k 442)/
yHk(442)
320/
Packaging Report Dialog Box xyfrHay:vmrnf/ Save Report Command Button uda k ½G;cs,yf g/ yH(k 443)/
uGefysLwmvufpJG
390
yHk(443)
321/ Save Report Dialog Box xyfrHay:vmrnf/ Save in: List Box wGif vrf;aMumif;ajymif;vdkyguajymif;NyD; Text File udkodrf;Edkifayonf/ yHk(444)/
yHk(444)
322/
c:\My Documents\Package odkYvrf;aMumif;ajymif;yg/ xdkYaemuf Save Command Button uda k ½G;cs,yf g/ yH(k 445)/
yHk(445)
323/
yH(k 443)ygtwdik ;f Dialog Box xyfraH y:vmrnf/ a½G;cs,yf g/ yH(k 446)/ Close Command Button udka½G;cs,fyg/
391
Microsoft Visual Basic 6.0
yHk(446)
324/ yHk(447)ygtwdkif; Package and Deployment Wizard Dialog Box xyfrH ay:vmrnf/ Close Command Button udka½G;cs,fyg/ rlvy½dk*&rfodkYomjyefa&muf oGm;rnf/
yHk(447)
325/ Application Package tm; C:\My Documents\Package xJ w G i f vrf;aMumif;ay;xm;ojzifh uGefysLwm Desktop ay:wGif½Sdaeonfh Icon wpfckjzpfaom My Computer rS Munfhygu yHk(448)ygtwdkif;jrifawGUEdkifygonf/
uGefysLwmvufpJG
392
yHk(447)
326/
tjcm;uGeyf sLwmpufwpfv;kH odYk Install jyKvyk v f ykd gu C:\My Documents\ Package Folder atmuf½Sdzdkiftm;vHk;udk ul;oGm;NyD; Setup.exe udk Double Click ESdyf &rnfjzpfonf/ Microsoft Visual Basic 6.0 rwyfqif&ao;aom uGefysLwmrsm;wGif vnf; Install vkyNf y;D ygu Run í&Edkifayonf/
---------------0-0-0---------------
393
Microsoft Visual Basic 6.0
tjcm;uGeyf sLwmrsm;odYk jyefvnf Install jyKvkyfjcif; 327/ yH(k 447)wGiaf wGUjrifae&aom zdik rf sm;udk Compact Disc (CD) jzifah omfvnf; aumif;? Diskette jzifhaomfvnf;aumif;ul;,lí tjcm;uGefysLwmpufwpfvHk;odkY Install jyKvkyfEdkifayonf/ tqdkygzdkifrsm;xJrS Setup.exe udk Double Click ESyd yf g/ yH(k 448)yg twdkif;jrifawGU&rnf/ OK Command Button udka½G;cs,f&rnf/
yHk(448)
328/
aemufxyf Dialog Box wpfckxyfrHay:vmrnf/ yHk(449)/
uGefysLwmvufpJG
394
yHk(449) 329/
uGefysLwmyHkygaom Command Button tm;a½G;cs,fygu C:\Program Files\ Project1 xJwGif Install jyKvkyfrnfjzpfNyD;tjcm;vrf;aMumif;ajymif;vJí Install vkyv f ykd gu Change Directory udak ½G;írdrEd pS o f uf&mvrf;aMumif;ajymif; Install jyKvyk f Edik af yonf/ xdaYk Mumifh uGeyf sLwmyHyk gaom Command Button tm;a½G;cs,yf g/ yH(k 450)yg Dialog Box wpfckxyfrHay:vmrnf/
395
Microsoft Visual Basic 6.0
yHk(450) 330/ Continue Command Button udka½G;cs,f&rnf/ y½dk*&rfrsm;tm; Install vkyfNyD;ygu yHk(451)ygtwdkif; atmifjrifpGmNyD;qHk;aMumif; Message Box ay:vmygu OK udk Click vky& f efjzpfygonf/
yHk(451)
uGefysLwmvufpJG
396
331/ y½d*k &rfrsm;onf uGeyf sLwmxJwiG f C:\Program Files\Project1 vrf;aMumif; atmufodkYa&muf½SdoGm;onfudk My Computer Short Icon tqifq h ifu h akd ½G;cs,jf cif;jzifh jrifawGU Edkifayonf/ yHk(452)/
yHk(452)
332/
tqdyk g extest111.exe zdkifudk Run ygu y½d*k &rftouf0ifrnfjzpfonf/
---------------0-0-0--------------InputBox a&;xHk;jzifh Password jyKvkyfjcif; 333/ InputBox a&;xH;k jzifh Password jyKvy k &f eftwGuf yH(k 453)wGiaf zmfjyxm;onfh Form zdi k w f pfcu k w kd nfaqmufyg/
yHk(453)
334/ yHk(453)yg Form zd k i f w G i f Label, Timer, Command Button wdkYjzifh wnfaqmufxm;NyD; vdktyfaom Properties rsm;udkjyifqifí y½dk*&rfrsm;udka&;om;& ayrnf/
397
Microsoft Visual Basic 6.0
335/
Label1 - Label Properties twGuf(u) (Name) Label1 ( c) Alignment 2 - Center ( *) AutoSize False (C) BackColor &H80000018& ( i) BackStyle 1 - Opaque ( p) BorderStyle1 - Fixed Single (q) ForeColor &H80000002&
336/
Command1 - Command Button Properties rSm (u) (Name) Command1 ( c) Caption E&xit ( *) Font MS Sans Serif, Regular, 8
337/
Timer1 - Timer Properties rSm (u) (Name) Timer1 ( c) Enabled True ( *) Index Empty (C) Interval 100 ( i) Left 3960 ( p) Tag Empty (q) Top 1920
338/
Exit Command Button twGufPrivate Sub Command1_Click() Unload Me End End Sub
339/
Form Load twGufPrivate Sub Form_Load() Dim Pw, Pword a=1 Pw = "Naing" Do While a <= 3 Pword = InputBox("Type in your password", "Password")
uGefysLwmvufpJG
398
If Pword <> Pw Then MsgBox "Sorry, incorrect password" Else Exit Sub End If a=a+1 Loop End End Sub
340/
Timer1_Timer() twGufPrivate Sub Timer1_Timer() Dim i As Integer Label1.BackColor = &H80000018 Label1.ForeColor = blue Label1.Caption = Now End Sub
341/
txufygy½dk*&rfudk Run ygu yH(k 454)ygtwdik ;f jzpfay:vmrnf/
yHk(454)
342/
InputBox a&;xH;k jzifah &;xm;ojzifh yxrOD;pGm Password awmif;onfh Input Box ay:vmrnf/ rdrdrS Password udkrSefuefpGm½dkufESdyfEdkifygu wpfBudrfwnf;y½dk*&rf Run rnfjzpfonf/ Password (3)Budrf½dkufírSefuefrIr½Sdygu y½dk*&rfxJrSxGufoGm;vdrfh rnf/ 3 BudrftwGif; Password wpfcgr[kww f pfcgrSeu f efr½I rdS o S m y½d*k &rf Run rnfjzpf onf/ yxrtBudrfwGif naing [k½dkufESdyfNyD; Enter odkYr[kwf OK Command Button udak ½G;cs,yf guyH(k 455)ygtwdik ;f Message Box wpfcjk zifjh yrnfjzpfonf/ Enter odrYk [kwf OK Command Button udka½G;cs,fyg/
399
Microsoft Visual Basic 6.0
yHk(455)
343/ xdktcg Input Box aemufwpfzefjyefay:vmygu Password trSefudk jznfhpGufí Enter (odkYr[kwf) OK Command Button udka½G;cs,f&rnf/ yHk(456)/
yHk(456)
344/ xdt k cg y½d*k &rf Run vmrnfukd yH(k 457)ygtwdik ;f jrifawGUEdik af yonf/ y½d*k &rfrS xGuv f ykd gu Exit Command Button udka½G;cs,f&rnf/
yHk(457)
---------------0-0-0---------------
uGefysLwmvufpJG
400
omrefa&;xHk;jzifh Password jyKvkyfjcif; 345/ omrefa&;xHk;jzifh Password jyKvkyf&eftwGuf yHk(458)wGifazmfjyxm;onfh Form zdi k w f pfcu k w kd nfaqmufyg/
yHk(458)
346/ yHk(458)yg Form zdkifwGif Label, Text Box, Command Button wdkYjzifh wnfaqmufxm;Ny;D vdt k yfaom Properties rsm;udjk yifqifí y½d*k &rfrsm;udak &;om;&ay rnf/ 347/
Label1 - Label Properties twGuf(u) (Name) Label1 ( c) Alignment 0 - Left Justify ( *) AutoSize True (C) BackColor &H8000000F& ( i) BackStyle 0 - Transparent ( p) BorderStyle 0 - None (q) Caption Enter Password = = = > ( Z) ForeColor &H80000012&
348/
Command1 - Command Button Properties rSm (u) (Name) Command1 ( c) Caption &Run ( *) Font MS Sans Serif, Regular, 8
401
Microsoft Visual Basic 6.0
349/
Run Command Button twGufPrivate Sub Command1_Click() Dim Pw, Pword Pw = "Naing" Pword = Text1.Text If Pword <> Pw Then Label2.Caption = "Sorry, incorrect password" Else Form1.Hide Form2.Show End If End Sub
350/
Form Load twGufPrivate Sub Form_Load() If Text1.PasswordChar = "" Then Text1.PasswordChar = "*" Else Text1.PasswordChar = "" End If End Sub
351/ Password rSefuefrI½Sdyguaemufxyf Form zdkifwpfckay:vmap&eftwGuf xyfrH í Form zdkifwpfckwnfaqmuf&rnf/ yHk(459)/
yHk(459)
uGefysLwmvufpJG
402
352/ yHk(459)yg Form zdkifwGif Text Box, Timer, Command Button wdkYjzifh wnfaqmufxm;Ny;D vdt k yfaom Properties rsm;udjk yifqifí y½d*k &rfrsm;udak &;om;&ay rnf/ 353/
Text1 - TextBox Properties twGuf(u) (Name) Text1 ( c) Alignment 2 - Center ( *) AutoSize True (C) BorderStyle1 - Fixed Single ( i) Font MS Sans Serif, Regular, 14 ( p) Text Empty
354/
Text2 - TextBox Properties twGuf(u) (Name) Text2 ( c) Alignment 2 - Center ( *) AutoSize True (C) BorderStyle1 - Fixed Single ( i) Font MS Sans Serif, Regular, 14 ( p) Text Empty
355/
Timer1 - Timer Properties rSm (u) (Name) Timer1 ( c) Enabled True ( *) Index Empty (C) Interval 100 ( i) Left 960 ( p) Tag Empty (q) Top 1800
356/
Command1 - Command Button Properties rSm (u) (Name) Command1 ( c) Caption E&xit ( *) Font MS Sans Serif, Regular, 8
403
Microsoft Visual Basic 6.0
357/
Exit Command Button twGufPrivate Sub Command1_Click() Unload Me End End Sub
358/
Form Load twGufPrivate Sub Form_Load() Text1.Text = Time$ Text2.Text = Date$ End Sub
359/
Timer1_Timer() twGufPrivate Sub Timer1_Timer() Text1.Text = Time$ End Sub
360/
yH(k 458)yg Form zdkifudk Run ygu yH(k 460)ygtwdik ;f jzpfay:vmrnf/
yHk(460)
361/ Text Box wGif rdrdtaejzifh jzpfEdkifonfxifonfh pmom;udk½dkuf&rnf/ Oyrm - Maung [k½u kd yf g/ Text Box wGif Asterisk (*) rsm;omay:vmrnf/ Run Command Button udka½G;onfjzpfap? Alt+R udka½G;onfjzpfap Password rSefuefrI½SdrSom y½dk*&rf Run rnfjzpfonf/ Password rrSeu f efygu yH(k 461)ygtwdik ;f jyovdrrhf nf/
uGefysLwmvufpJG
404
yHk(461)
362/ Password udr k eS u f efpmG ½du k rf xnfEh ikd yf gu y½d*k &rfxo J v Ykd ;kH 00ifciG jhf yKrnf r[kwf bJ Password rSeu f efr½I rdS o S m aemuf Form wpfco k q Ykd ufvuftvkyv f yk rf nfjzpfygonf/ xdkYaMumifhy½dk*&rfxJwGifowfrSwfxm;aom Password jzpfaom Naing udk jznfhpGufNyD; Enter odr Yk [kwf OK Command Button udak ½G;cs,yf g/ yH(k 462)ygtwdik ;f jzpfay:vmrnf/ y½dk*&rfxJrSxGufvdkygu Exit Command Button udak ½G;cs,yf g/
yHk(462)
---------------0-0-0---------------
405
Microsoft Visual Basic 6.0
Chapter (12) Microsoft Internet Explorer wGif HTML zdkifrsm;udkqJG,ltoHk;jyKjcif; 363/ yxrOD;pGm Microsoft Internet Explorer wGif Run í&Edkifap&ef HTML (Hyper Text Mark-Up Language) jzifh y½dk*&rfrsm;udk a&;om;&rnf/ Oyrm c:\html_notes vrf;aMumif;xJwGif rdrdtvdk½Sdonfh HTML zdkifrsm;a&;om;xm;&rnf/
364/
Index.htm zdkiftwGuf-
My Home Page (Index File)
365/
header.htm zdkiftwGuf-
Web Page Header <marquee align="middle" behavior="alternate" direction="right"> Welcome to My Home Page
366/
content.htm zdkiftwGuf-
Content
uGefysLwmvufpJG
406
HTML Lessons
1. Heading 2. Horizontal Ruler 3. Text Format 4. Font Size 5. Font Color 6. Font Face 7. BGSound 8. BGColorCode 9. Font Attr. 10. Font Type 11. Text Format 12. Paragraph 13. Form Table 14. Images 15. Image Table 16. Table1 17. Video 18. VBScript 19. Javascript 20. HTML Option 21. Thank You
** Excercise001 ** Java_TextTyper Links to Other Site (Applet Effects) * Water * Water2 * Water3 * Bump
407
Microsoft Visual Basic 6.0
* Bump2 * Bump3 * Lens * Lens2 * Lens3
367/
main.htm zdkiftwGuf-
Main Area in Frame Page
A Practical Application
of
HTML Basic Lessons
368/
heading.htm zdkiftwGuf-
Heading Text Styles Heading 1 Heading 2 Heading 3
uGefysLwmvufpJG
408
Heading 4 Heading 5 Heading 6 Normal Size
369/
hruler2.htm zdkiftwGuf-
Horizontal Ruler
370/
format.htm zdkiftwGuf-
Text Formatting Bold Text Bold Text Bold Text Underlined Text Underlined Text Underlined Text Italic Text Italic Text Italic Text
371/
font size.html zdkiftwGuf-
Font Size Font Size =1 Font Size =2
409
Microsoft Visual Basic 6.0
Font Size =3 Font Size =4 Font Size =5 Font Size =6 Font Size =7
372/
font color.html zdkiftwGuf-
Font Color Font Color=red Font Color=green Font Color=blue Font Color=yellow Font Color=cyan Font Color=silver Font Color=lime This is arial font.
373/
font face.html zdkiftwGuf-
Font Face face=times face=arial face=times new roman face=arial black pmvkH;=0if;uavm pmvkH;=0if;uavm face=Haettenschweiler
uGefysLwmvufpJG
410
374/
bgsound.htm zdkiftwGuf-
Background Sond is playing (Another Directory) Background Sound is playing ...
375/
BGColorCode.htm zdkiftwGuf-
Background Color Code BGCOLOR is Green ... (Code)
376/
font attrs.html zdkiftwGuf-
Other Font Attributes This is normal text on body <strong>Strong Text <strong><strong>Strong and strong Text <strike>Strike through on Text Big Text Big and big Text <small>Small Text <small><small>Small and small Text Super Script and Subscript H<sub>2O
411
Microsoft Visual Basic 6.0
X<sup>2+y-10 This is a Monotype Text Style. This is a Monotype Text Style, This is a Monotype Text Style, This is a Monotype Text Style.
377/
fontType.html zdkiftwGuf-
Font Type <pre> 1. Pre-formated 2. Pre-formated Pre-formated Pre-formated Acronym Acronym Acronym Address Address Address BlockQuote BlockQuote BlockQuote Cite Cite Cite <del>Del Del Del Defination Defination Defination <em>Em Em Em Insert Insert Insert
uGefysLwmvufpJG 378/
412
format.htm zdkiftwGuf-
Text Formatting Bold Text Bold Text Bold Text Underlined Text Underlined Text Underlined Text Italic Text Italic Text Italic Text
379/
Paragraph.htm zdkiftwGuf-
Sparating Paragraphs Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1
Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1 Paragraph1
380/
Form_table1.htm zdkiftwGuf <TITLE>JavaScript & Forms
413
Microsoft Visual Basic 6.0
<SCRIPT LANGUAGE="JavaScript">
381/
Images.htm zdkiftwGuf-
Using Miage Tags
uGefysLwmvufpJG 382/
416
ImageTable.htm zdkiftwGuf-
Table and Images Image Table b>
417 383/
Microsoft Visual Basic 6.0
Table1.htm zdkiftwGuf-
Table Cells Cell1 Cell2 Cell3 Cell4 Cell5 Cell6
384/
Video.htm zdkiftwGuf-
Video is playing (Another Directory)
uGefysLwmvufpJG
418
Video is playing ...
385/
VBScript.htm zdkiftwGuf <TITLE>VBScript & Form Example <SCRIPT LANGUAGE="VBScript">
419
Microsoft Visual Basic 6.0
386/
Javascript.htm zdkiftwGuf <TITLE>JavaScript & Forms <SCRIPT LANGUAGE="JavaScript">
387/
HTML_Option.htm zdkiftwGuf<TITLE>MyPage
uGefysLwmvufpJG
420
HTML_Option This is Heading 2 Style <SELECT NAME=Selection1> Font Face Font Size Font Color
388/
Thanks.htm zdkiftwGuf-
Thanks Thank your for Visit to My Home Page
421
Microsoft Visual Basic 6.0
389/
Exercise001.htm zdkiftwGuf <TITLE>JavaScript & Forms (Fahrenheit to Centigrade) <SCRIPT LANGUAGE="JavaScript">
uGefysLwmvufpJG
422
390/
Java_TextTyper.htm zdkiftwGuf TextTyper v2.5 <META http-equiv="Content-Type" content="text/html; harset=iso-8859-1"> <style type="text/css"> <script type="text/javascript" language="javascript"> Loading TextTyper ... Sy s t e m V e r s i o n . . . . v2.5 L i f e S u p p o r t . . . . -ok V i t a l S y s t e m s . . . . -ok S a n i t y . . . . -Error ");
423
Microsoft Visual Basic 6.0
var overMe=0; function txtTyper(str, idx, idObj, spObj, clr1, clr2, delay, plysnd) { var tmp0 = tmp1 = '', skip = 0; if (both && idx <= str.length) { if (str.charAt(idx) == '<') { while (str.charAt(idx) != '>') idx++; idx++; } if (str.charAt(idx) == '&' && str.charAt(idx+1) != ' ') { while (str.charAt(idx) != ';') idx++; idx++; } tmp0 = str.slice(0,idx); tmp1 = str.charAt(idx++); if (overMe==0 && plysnd==1) { if (navigator.plugins[0]) { if (navigator.plugins["LiveAudio"][0].type=="audio/basic" && navigator.javaEnabled()) { document.embeds[0].stop(); setTimeout("document.embeds[0].play(false)",100); } } else if (document.all) { ding.Stop(); setTimeout("ding.Run()",100); } overMe=1; } else overMe=0; writeOnText(idObj, "<span class="+spObj+"> "+tmp0+" "+tmp1+" "); setTimeout("txtTyper('"+str+"', "+idx+", '"+idObj+"', '"+spObj+"', '"+clr1+"', '"+clr2+"', "+delay+" , "+plysnd+")",delay); } } function init() { txtTyper(dispStr[0], 0, 'ttl0', 'ttl1', '#339933', '#99FF33', 50, 0);
uGefysLwmvufpJG
424
} // -->
<embed src="type.au" width="37" height="0" controls="playbutton" hidden="true" autostart="false" alt=""> -->
391/
Water3.html zdkiftwGuf <META NAME="GENERATOR" CONTENT="Microsoft FrontPage 4.0"> <TITLE>The Water-applet!
425
Microsoft Visual Basic 6.0
="#0000FF" SIZE="+1"><span style="background-color: #00FF00">Activate your mouse on the center area.
<APPLET WIDTH="190" HEIGHT="190" ALIGN="BOTTOM" CODE="WaterApp.class" CODEBASE="./">
1 , 2 .
392/
Bump.html zdkiftwGuf <META NAME="GENERATOR" CONTENT="Adobe PageMill 3.0 Win"> <TITLE>The Bump Applet!
uGefysLwmvufpJG
426
Back to the applet page
<APPLET WIDTH="256" HEIGHT="256" ALIGN="BOTTOM" CODE="BumpApp.class" CODEBASE="./">
2 , 3 .
393/
Bump2.html zdkiftwGuf <META NAME="GENERATOR" CONTENT="Adobe PageMill 3.0 Win"> <TITLE>The Bump Applet!
427
Microsoft Visual Basic 6.0
ALINK="#50b090"> Back to the applet page
<APPLET WIDTH="230" HEIGHT="230" ALIGN="BOTTOM" CODE="BumpApp.class" CODEBASE="./">
1 , 3 .
394/
Bump3.html zdkiftwGuf <META NAME="GENERATOR" CONTENT="Adobe PageMill 3.0 Win"> <TITLE>The Bump Applet!
uGefysLwmvufpJG
428
Back to the applet page
<APPLET WIDTH="300" HEIGHT="300" ALIGN="BOTTOM" CODE="BumpApp.class" CODEBASE="./">
1 , 2 .
395/
Lens.html zdkiftwGuf <META NAME="GENERATOR" CONTENT="Adobe PageMill 3.0 Win">
429
Microsoft Visual Basic 6.0
<TITLE>The Lens Applet! Back to the applet page
<APPLET WIDTH="300" HEIGHT="300" ALIGN="BOTTOM" CODE="LensApp.class" CODEBASE="./">
2 , 3 .
396/
Lens2.html zdkiftwGuf <META NAME="GENERATOR" CONTENT="Adobe PageMill 3.0 Win"> <TITLE>The Lens Applet!
uGefysLwmvufpJG
430
Back to the applet page
<APPLET WIDTH="300" HEIGHT="300" ALIGN="BOTTOM" CODE="LensApp.class" CODEBASE="./">
1 , 3 .
431
Microsoft Visual Basic 6.0
397/
Lens3.html zdkiftwGuf <META NAME="GENERATOR" CONTENT="Adobe PageMill 3.0 Win"> <TITLE>The Lens Applet! Back to the applet page
<APPLET WIDTH="230" HEIGHT="230" ALIGN="BOTTOM" CODE="LensApp.class" CODEBASE="./">
1 , 2 .
uGefysLwmvufpJG
432
398/ txufyg HTML zdik rf sm;tm; y½d*k &rfjzifq h w GJ if&eftwGuf Form zdik w f pfcu k kd wnfaqmuf&rnf/
yHk(463)
399/ yH(k 463)yg Form zdkifwGif Timer, Label, Progress Bar wdkYjzifh wnfaqmuf xm;NyD; vdktyfaom Properties rsm;udkjyifqifí y½dk*&rfrsm;udka&;om;&ayrnf/ 400/
Timer1 - Timer Properties rSm (u) (Name) Timer1 ( c) Enabled True ( *) Index Empty (C) Interval 5000 ( i) Left 3480 ( p) Tag Empty (q) Top 0
433
Microsoft Visual Basic 6.0
401/
Label1 - Label Properties rSm (u) (Name) Label1 ( c) Alignment 2 - Center ( *) AutoSize False (C) BackStyle 1 - Opaque ( i) BorderStyle1 - Fixed Single ( p) Caption uGefysLwmXme (uGefysLwmXme) (q) Font -Win---Taungyi, Bold, 36
402/
ProgressBar1 - ProgressBar Properties rSm (u) (Name) ProgressBar1 ( c) Align 0 - vbAlignNone ( *) Max 1000 (C) Min 0 ( i) Font MS Sans Serif, Regular, 8
403/
Timer1 Timer() twGufPrivate Sub Timer1_Timer() Private Sub Timer1_Timer() Dim n1 As Integer For n1 = 1 To 1000 Form1.Caption = "Processing Step " & Trim$(CStr(n1)) & " of 1000" ProgressBar1 = n1 Next n1 Call Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE c:\html_notes\index.htm", 1) End End Sub
uGefysLwmvufpJG 404/
434
yH(k 463)yg Form zdkifudk Run ygu yH(k 464)ygtwdik ;f jzpfay:vmrnf/
yHk(464)
405/ acwåcP(Oyrm-5 puúefYcefY)Mumjrifhygu yHk(465)ygtwdkif;y½dk*&rf Run rnf jzpfonf/ Time Interval tm; 5000 ay;xm;aomaMumifhjzpfonf/
yHk(465)
406/
Progress Bar wef;jynfo h mG ;ygu yH(k 466)ygtwdik ;f Microsoft Internet Explorer ay:vmNyD; HTML jzifha&;om;xm;onfh y½dk*&rfrsm;udk toHk;csí&NyDjzpfonf/ tu,fí Microsoft Internet Explorer rSxu G v f ykd gu Close Button udEk ydS &f rnf/
435
yHk(466)
Microsoft Visual Basic 6.0
uGefysLwmvufpJG
436 Chapter (13)
Application Package rsm;udky½dk*&rfjzifhzGifhjcif; 1/ Microsoft Visual Basic 6.0 jzifh Application Package rsm;udkqJGwif vdyk gu atmufygtwdik ;f Form wpfckudkwnfaqmuf&rnf/ yHk(467)/
yHk(467)
2/
Form1 - Form Properties rSm (u) (Name) - Form1 ( c) BorderStyle- 2 - Sizable ( *) Caption - Openning of the Application Package (C) Font - MS Sans Serif, Regular, 8 ( i) WindowState- 0 - Normal
3/
Command1 - Command Button Properties rSm (u) (Name) - Command1 ( c) Caption - Open Microsoft &Word ( *) Font - MS Sans Serif, Regular, 8
4/
Command2 - Command Button Properties rSm (u) (Name) - Command2 ( c) Caption - Open Microsoft &Excel ( *) Font - MS Sans Serif, Regular, 8
437
Microsoft Visual Basic 6.0
5/
Command3 - Command Button Properties rSm (u) (Name) - Command3 ( c) Caption - Open Microsoft &Access ( *) Font - MS Sans Serif, Regular, 8
6/
Command4 - Command Button Properties rSm (u) (Name) - Command4 ( c) Caption - Open Adobe &Page Maker 6.5 ( *) Font - MS Sans Serif, Regular, 8
7/
Command5 - Command Button Properties rSm (u) (Name) - Command5 ( c) Caption - E&xit ( *) Font - MS Sans Serif, Regular, 8
8/
Command1 - Command Button twGufPrivate Sub Command1_Click() Dim MyAppID MyAppID = Shell("C:\Program Files\Microsoft Office\Office10\ WINWORD.EXE", 1) End Sub
9/
Command2 - Command Button twGufPrivate Sub Command2_Click() Dim MyAppID MyAppID = Shell("C:\Program Files\Microsoft Office\Office10\ EXCEL.EXE", 1) End Sub
10/
Command3 - Command Button twGufPrivate Sub Command3_Click() Dim MyAppID MyAppID = Shell("C:\Program Files\Microsoft Office\Office10\ MSACCESS.EXE", 1) End Sub
uGefysLwmvufpJG
438
11/
Command4 - Command Button twGufPrivate Sub Command4_Click() Dim MyAppID MyAppID = Shell("C:\PM65\PM65.EXE", 1) End Sub
12/
Command5 - Command Button twGufPrivate Sub Command5_Click() Unload Me End End Sub ---------------0-0-0---------------
439
Microsoft Visual Basic 6.0
Chapter (14)
taxGaxG Multiple List Box rsm;zefwD;jcif; 1/ atmufygtwdkif; Form wpfckudkwnfaqmuf&rnf/ yHk(468)/ 4if;wGif Lah efw;D xm;Ny;D oufqikd &f m Properties rsm;udk bel, Text Box, Command Button wdjYk zifz jyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif atmufygy½dk*&rfrsm;udka&;om;
&rnf/
yHk(468)
2/
Lable1 Properties twGuf(u) (Name) - Label1 ( c) AutoSize - True ( *) BackStype - 0 - Transparent (C) Caption - How many number?
3/
Lable2 Properties twGuf(u) (Name) - Label2 ( c) AutoSize - True ( *) BackStype - 0 - Transparent (C) Caption - Enter each number = >
uGefysLwmvufpJG
440
4/
Text1 Text Box Properties twGuf(u) (Name) - Text1 ( c) Alignment - 0 - Left Justified ( *) Index - Empty (C) Locked - False ( i) Text - Empty
5/
Text2 Text Box Properties twGuf(u) (Name) - Text ( c) Alignment - 0 - Left Justified ( *) Index - 1 (C) Locked - False ( i) Text - Empty
6/
Command1 Command Button Properties twGuf(u) (Name) - Command1 ( c) Caption - &Add (Text Box) ( *) Enabled - True
7/
Command2 Command Button Properties twGuf(u) (Name) - Command2 ( c) Caption - E&xit ( *) Enabled - True
8/
Form1 Form Properties twGuf(u) (Name) - Form1 ( c) Enabled - True ( *) Caption - Example Multiple Text Box
9/
Object: General, Proc: [Declaration] twGuf Dim a1, a2 As Inte-
ger [ka&;om;&rnf/
10/
Add (Text Box) - Command1 Button twGufPrivate Sub Command1_Click() a2 = Val(Text1) If a1 = 0 Then a1 = 1 If a1 > a2 Then Exit Sub a1 = a1 + 1
441
Microsoft Visual Basic 6.0
Text1.Locked = True Load Text(a1) b1 = Text(a1).Name 'Text(a1).Name="Text" b2 = Text(a1).Index 'Text(a1).Index = a1+1 b1 = "Text" b2 = a1 + 1 Text(a1).Locked = True Text(a1).Top = Text(a1 - 1).Top + 400 Text(a1).Left = Text(a1).Left - 400 Text(a1).Visible = True Print Text(a1), Text(a1).Name, Text(a1).Index Text(a1) = Text(a1) End Sub
11/
Exit - Command2 Button twGufPrivate Sub Command2_Click() Unload Me 'Unload this form End End Sub
12/
txufygy½dk*&rfudk Run ygu yHk(469)ygtwdkif;jrifawGU&rnfjzpfygonf/
yHk(469)
---------------0-0-0---------------
uGefysLwmvufpJG
442
Exchange Sort udk Visual Basic jzifha&;om;jcif; 13/ atmufygtwdkif; Form wpfckudkwnfaqmuf&rnf/ yHk(470)/ 4if;wGif Label, Text Box, Command Button wdjYk zifz h efw;D xm;Ny;D oufqikd &f m Properties rsm;udk jyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif atmufygy½dk*&rfrsm;udk a&;om;
&rnf/
yHk(470)
14/
Lable1 Properties twGuf(u) (Name) - Label1 ( c) AutoSize - True ( *) BackStype - 0 - Transparent (C) Caption - How many number?
15/
Lable2 Properties twGuf(u) (Name) - Label2 ( c) AutoSize - True ( *) BackStype - 0 - Transparent (C) Caption - Enter each number = >
443
Microsoft Visual Basic 6.0
16/
Text1 Text Box Properties twGuf(u) (Name) - Text1 ( c) Alignment - 0 - Left Justified ( *) Index - Empty (C) Locked - False ( i) Text - Empty
17/
Text2 Text Box Properties twGuf(u) (Name) - Text ( c) Alignment - 0 - Left Justified ( *) Index - 1 (C) Locked - False ( i) Text - Empty
18/
Command1 Command Button Properties twGuf(u) (Name) - Command1 ( c) Caption - &Add (Text Box) ( *) Enabled - True
19/
Command2 Command Button Properties twGuf(u) (Name) - Command2 ( c) Caption - &Exchange Sort ( *) Enabled - True
20/
Command3 Command Button Properties twGuf(u) (Name) - Command3 ( c) Caption - E&xit ( *) Enabled - True
21/
Form1 Form Properties twGuf(u) (Name) - Form1 ( c) Enabled - True ( *) Caption - Exchange Sort (Ascending Order)
22/
Object: General, Proc: [Declaration] twGuf Dim num1, n, k(50) As Integer [ky½dk*&rfa&;om;&efjzpfygonf/
uGefysLwmvufpJG
444
23/
Add (Text Box) - Command1 Button twGufPrivate Sub Command1_Click() n = Val(Text1) Text1.Locked = True If num1 = 0 Then num1 = 1 If num1 > n Then Exit Sub num1 = num1 + 1 Load Text(num1) b1 = Text(num1).Name 'Text(num1).Name="Text" b2 = Text(num1).Index 'Text(num1).Index = num1+1 Text(num1).Locked = True Text(num1).Top = Text(num1 - 1).Top + 400 Text(num1).Left = Text(num1).Left - 400 Text(num1).Visible = True Print Text(num1), Text(num1).Name, Text(num1).Index i = Text(num1).Index - 1 k(i) = Text(num1) Print k(i), i End Sub
24/
Exchange Sort - Command2 Button twGufPrivate Sub Command2_Click() Cls For i = 1 To n - 1 For j = 1 To n - 1 If k(j) <= k(j + 1) Then GoTo 100 t = k(j): k(j) = k(j + 1): k(j + 1) = t 100 Next j Next i For x = 1 To n Print k(x) Next End Sub
445
Microsoft Visual Basic 6.0
25/
Exit - Command3 Button twGufPrivate Sub Command3_Click() Unload Me End End Sub
26/
txufyg y½dk*&rfudk Run ygu yHk(471)ygtwdkif;jrifawGU&rnfjzpfygonf/
yHk(471)
---------------0-0-0---------------
uGefysLwmvufpJG
446
Counting Sort udk Visual Basic jzifha&;om;jcif; 27/ atmufygtwdkif; Form wpfckudkwnfaqmuf&rnf/ yHk(472)/ 4if;wGif Label, Text Box, Command Button wdjYk zifz h efw;D xm;Ny;D oufqikd &f m Properties rsm;udk jyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif atmufygy½dk*&rfrsm;udk a&;om;
&rnf/
yHk(472)
28/
Lable1 Properties twGuf(u) (Name) - Label1 ( c) AutoSize - True ( *) BackStype - 0 - Transparent (C) Caption - How many number?
29/
Lable2 Properties twGuf(u) (Name) - Label2 ( c) AutoSize - True ( *) BackStype - 0 - Transparent (C) Caption - Enter each number = >
447
Microsoft Visual Basic 6.0
30/
Text1 Text Box Properties twGuf(u) (Name) - Text1 ( c) Alignment - 0 - Left Justified ( *) Index - Empty (C) Locked - False ( i) Text - Empty
31/
Text2 Text Box Properties twGuf(u) (Name) - Text ( c) Alignment - 0 - Left Justified ( *) Index - 1 (C) Locked - False ( i) Text - Empty
32/
Command1 Command Button Properties twGuf(u) (Name) - Command1 ( c) Caption - &Add (Text Box) ( *) Enabled - True
33/
Command2 Command Button Properties twGuf(u) (Name) - Command2 ( c) Caption - &Counting Sort ( *) Enabled - True
34/
Command3 Command Button Properties twGuf(u) (Name) - Command3 ( c) Caption - E&xit ( *) Enabled - True
35/
Form1 Form Properties twGuf(u) (Name) - Form1 ( c) Enabled - True ( *) Caption - Counting Sort (Ascending Order)
36/
Object: General, Proc: [Declaration] twGuf Dim num1, n, k(50), f(50), kount(50) As Integer [ky½dk*&rfa&;om;&efjzpfygonf/
uGefysLwmvufpJG
448
37/
Add (Text Box) - Command1 Button twGufPrivate Sub Command1_Click() n = Val(Text1) Text1.Locked = True If num1 = 0 Then num1 = 1 If num1 > n Then Exit Sub num1 = num1 + 1 Load Text(num1) b1 = Text(num1).Name 'Text(num1).Name="Text" b2 = Text(num1).Index 'Text(num1).Index = num1+1 Text(num1).Locked = True Text(num1).Top = Text(num1 - 1).Top + 400 Text(num1).Left = Text(num1).Left - 400 Text(num1).Visible = True Print Text(num1), Text(num1).Name, Text(num1).Index i = Text(num1).Index - 1 k(i) = Text(num1) Print k(i), i Text(num1) = Text(num1) End Sub
38/
Counting Sort - Command2 Button twGufPrivate Sub Command2_Click() Cls For i = 1 To n kount(i) = 1 Next For i = 2 To n For j = 1 To i - 1 If k(i) > k(j) Then kount(i) = kount(i) + 1 Else kount(j) = kount(j) + 1 End If Next j Next i
449
Microsoft Visual Basic 6.0
For i = 1 To n f(kount(i)) = k(i) Next For x = 1 To n Print f(x) Next End Sub
39/
Exit - Command3 Button twGufPrivate Sub Command3_Click() Unload Me End End Sub
40/
txufyg y½dk*&rfudk Run ygu yHk(473)ygtwdkif;jrifawGU&rnfjzpfygonf/
yHk(473)
---------------0-0-0---------------
uGefysLwmvufpJG
450
Insertion Sort udk Visual Basic jzifha&;om;jcif; 41/ atmufygtwdkif; Form wpfckudkwnfaqmuf&rnf/ yHk(474)/ 4if;wGif Label, Text Box, Command Button wdjYk zifz h efw;D xm;Ny;D oufqikd &f m Properties rsm;udk jyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif atmufygy½dk*&rfrsm;udka&;om;
&rnf/
yHk(474)
42/
Lable1 Properties twGuf(u) (Name) - Label1 ( c) AutoSize - True ( *) BackStype - 0 - Transparent (C) Caption - How many number?
43/
Lable2 Properties twGuf(u) (Name) - Label2 ( c) AutoSize - True ( *) BackStype - 0 - Transparent (C) Caption - Enter each number = >
451
Microsoft Visual Basic 6.0
44/
Text1 Text Box Properties twGuf(u) (Name) - Text1 ( c) Alignment - 0 - Left Justified ( *) Index - Empty (C) Locked - False ( i) Text - Empty
45/
Text2 Text Box Properties twGuf(u) (Name) - Text ( c) Alignment - 0 - Left Justified ( *) Index - 1 (C) Locked - False ( i) Text - Empty
46/
Command1 Command Button Properties twGuf(u) (Name) - Command1 ( c) Caption - &Add (Text Box) ( *) Enabled- True
47/
Command2 Command Button Properties twGuf(u) (Name) - Command2 ( c) Caption - &Insertion Sort ( *) Enabled- True
48/
Command3 Command Button Properties twGuf(u) (Name) - Command3 ( c) Caption - E&xit ( *) Enabled- True
49/
Form1 Form Properties twGuf(u) (Name) - Form1 ( c) Enabled- True ( *) Caption - Counting Sort (Ascending Order)
50/
Object: General, Proc: [Declaration] twGuf Dim num1, n, k(50) As Integer [ky½dk*&rfa&;om;&efjzpfygonf/
uGefysLwmvufpJG
452
51/
Add (Text Box) - Command1 Button twGufPrivate Sub Command1_Click() n = Val(Text1) Text1.Locked = True If num1 = 0 Then num1 = 1 If num1 > n Then Exit Sub num1 = num1 + 1 Load Text(num1) b1 = Text(num1).Name 'Text(num1).Name="Text" b2 = Text(num1).Index 'Text(num1).Index = num1+1 Text(num1).Locked = True Text(num1).Top = Text(num1 - 1).Top + 400 Text(num1).Left = Text(num1).Left - 400 Text(num1).Visible = True Print Text(num1), Text(num1).Name, Text(num1).Index i = Text(num1).Index - 1 k(i) = Text(num1) Print k(i), i Text(num1) = Text(num1) End Sub
52/
Insertion Sort - Command2 Button twGufPrivate Sub Command2_Click() Cls For i = 2 To n current = k(i) j=i-1 70 If j < 1 Or current >= k(j) Then GoTo 100 k(j + 1) = k(j) j=j-1 GoTo 70 100 k(j + 1) = current Next i Do While j >= 1 And current < k(j) k(j + 1) = k(j) j=j-1 Loop
453
Microsoft Visual Basic 6.0
For x = 1 To n Print k(x) Next End Sub
53/
Exit - Command3 Button twGufPrivate Sub Command3_Click() Unload Me End End Sub
54/
txufyg y½dk*&rfudk Run ygu yHk(475)ygtwdkif;jrifawGU&rnfjzpfygonf/
yHk(475)
---------------0-0-0---------------
uGefysLwmvufpJG
454
Selection Sort with Exchange udk Visual Basic jzifha&;om;jcif; 55/ atmufygtwdkif; Form wpfckudkwnfaqmuf&rnf/ yHk(476)/ 4if;wGif Label, Text Box, Command Button wdjYk zifz h efw;D xm;Ny;D oufqikd &f m Properties rsm;udk jyifqifjznfhpGufNyD;aemuf Command Button rsm;wGif atmufygy½dk*&rfrsm;udka&;om;
&rnf/
yHk(476)
56/
Lable1 Properties twGuf(u) (Name) - Label1 ( c) AutoSize - True ( *) BackStype - 0 - Transparent (C) Caption - How many number?
57/
Lable2 Properties twGuf(u) (Name) - Label2 ( c) AutoSize - True ( *) BackStype - 0 - Transparent (C) Caption - Enter each number = >
455
Microsoft Visual Basic 6.0
58/
Text1 Text Box Properties twGuf(u) (Name) - Text1 ( c) Alignment - 0 - Left Justified ( *) Index - Empty (C) Locked - False ( i) Text - Empty
59/
Text2 Text Box Properties twGuf(u) (Name) - Text ( c) Alignment - 0 - Left Justified ( *) Index - 1 (C) Locked - False ( i) Text - Empty
60/
Command1 Command Button Properties twGuf(u) (Name) - Command1 ( c) Caption - &Add (Text Box) ( *) Enabled - True
61/
Command2 Command Button Properties twGuf(u) (Name) - Command2 ( c) Caption - &Selection Sort with Exchange ( *) Enabled - True
62/
Command3 Command Button Properties twGuf(u) (Name) - Command3 ( c) Caption - E&xit ( *) Enabled - True
63/
Form1 Form Properties twGuf(u) (Name) - Form1 ( c) Enabled - True ( *) Caption - Selection Sort with Exchange (Ascending Order)
64/
Object: General, Proc: [Declaration] twGuf Dim num1, n, k(50) As Integer [ky½dk*&rfa&;om;&efjzpfygonf/
uGefysLwmvufpJG
456
65/
Add (Text Box) - Command1 Button twGufPrivate Sub Command1_Click() n = Val(Text1) Text1.Locked = True If num1 = 0 Then num1 = 1 If num1 > n Then Exit Sub num1 = num1 + 1 Load Text(num1) b1 = Text(num1).Name 'Text(num1).Name="Text" b2 = Text(num1).Index 'Text(num1).Index = num1+1 Text(num1).Locked = True Text(num1).Top = Text(num1 - 1).Top + 400 Text(num1).Left = Text(num1).Left - 400 Text(num1).Visible = True Print Text(num1), Text(num1).Name, Text(num1).Index i = Text(num1).Index - 1 k(i) = Text(num1) Print k(i), i Text(num1) = Text(num1) End Sub
66/
Selection Sort with Exchange - Command2 Button twGufPrivate Sub Command2_Click() Cls For i = 1 To n - 1 mini = k(i): idx = i For j = i + 1 To n If k(j) >= mini Then GoTo 10 mini = k(j): idx = j 10 Next j k(idx) = k(i): k(i) = mini Next i For i = 1 To n Print k(i) Next
457
Microsoft Visual Basic 6.0
For i = 1 To n Print k(i) Next End Sub
67/
Exit - Command3 Button twGufPrivate Sub Command3_Click() Unload Me End End Sub
68/
txufyg y½dk*&rfudk Run ygu yHk(477)ygtwdkif;jrifawGU&rnfjzpfygonf/
yHk(477)
---------------0-0-0---------------
Related Documents