( : pp. 32~49) 1. (1) (object): ( :, ) ( ) :,, ( ), ( ) (2) (form): (3) (control): (4) (property):, (5) (method):
(6) (class): (7) (event) (event procedure) 1) : 2) : (8) : (GUI ) 2. : (*.frm) -> (compile) -> (*.exe) (p. 535 ) 3. (IDE (Integrated Development Environment)):,, 2
(1) ( ): (2) ( ): (main) -> (sub) -> ( ) (3) (4) : 1),, (5) : (6) : (7) : 1) 2),, 3) 4) 3
(8) : 1) ( ) ( ) 2) (.) ( : (T)-> -> -> ) 3) - - : - : underscore(_), underscore - ( ), Rem (9) : 4
( : pp. 60~62; pp. 92~109) 1. (variable):, ( ) a=5 b=6 c=a+b 2. (1) 1) 256 2),, underscore(_) 5
3) underscore 4) underscore 5) (reserved word), [ ] OK! ( ) - NumOfPeople, Crow1234, Do_Draw, _BeginEnd, [public] (O.K!) - Variable*, 4Crow, private, _ (Not Allowed!) (2) 1) 3., (1) : 1) (2) Option Explicit 6
1) : Option Explicit On/Off (3), (4) = ( ) Dim imyvar As Integer = 1234 4. (1) (local variable): 1) Dim 2) Static Permanent, (2) (module variable) (global variable):,, ( ) 1) : Private Dim 7
( ) Module mymodule Private strmymsg As String Sub Initialize() strmymsg= End Sub Sub Display() Debug.WriteLine(strMyMsg) End Sub End Module 2) : Public Friend ( ) Module mymodule1 Public strmymsg As String End Module 8
Module mymodule2 Sub Initialize() strmymsg= End Sub Sub Display() Debug.WriteLine(strMyMsg) End Sub End Module Module mymodule2 9
5. (data type) (1) (Byte) 1) : 1 byte 2) : 0~255( ) 3) ( ) Dim bycount As Byte (2) Short, (Integer), Long 1) : 2/4/8 bytes 2) : -32,678~32,677/-2,147,483,648~2,147,483,647/p. 67 3) ( ) Dim nmyvariable/imyvariable/lmyvariable As Short/Integer/Long (3) : 10
1)Single ( ) - : 4 bytes - : 1.401298E-45 ~ 3.402823E38 ( ) - ( ) Dim sheight As Single - 6 ( : 123456750.12 => 1.234568E08) 2)Double ( ) - : 8 bytes - : 4.94065645841247E-324 ~ 1.79769313486232E308( ) - ( ) Dim dblvolum As Double - 14 11
(4) Decimal : 1) : 12 bytes 2) : p.71 3) ( ) Dim dmyvariable as Decimal (5) (Char): 1) : 2 bytes 2) : 0~65535 3) ( ) Dim cmyvariable as Char (6) (String) 1) : 10+2*( ), 1 byte 2), ASCII 12
3) ( ) Dim strmyname As String 4) - + ( ) Dim strtitle, strname, strnumber As String strtitle= Queen strname=elizabeth strnumber=ii Debug.write(strTitle + strname + strnumber) - & : ( ) Dim ia As Integer Dim strb As String 13
ia=5 strb= men Debug.write(iA & strb) 5) (pp. 74~76 ) (7) (boolean) 1) : 1 byte 2) : True, False 3) ( ) Dim bisfirst As Boolean (8) Date 1) : 8 bytes 2) - 1 1 1 ~ 9999 12 31 ( ) 14
- 0:00:00 ~23:59:59 ( ) 3) ( ) Dim dttoday As Date 4) # ( : D=#96/11/14/ 11:20:35 PM# ) 5) ( pp. 79~81 ) (9) Object : 1) : 4 bytes 2) ( ) Dim objmyvariable1, objmyvariable2 as Object objmyvariable1=10 objmyvariable2= Hello 6. :, (p. 85 ) 15
1) ( ) Dim iintegervalue As Integer Dim bybytevalue As Byte bybytevalue=123 iintegervalue=bybytevalue 2) CType : - : CType(, ) 7. : VarType - : VarType( ) ( ) ivar=123 ; strvar= Hello MyType=VarType(iVar) Integer MyType=VarType(strVar) String 16
8. (p. 86~87 ) 9. : 1) : Option Strict On/Off 2), 10. : 1) [Public Private] Const [As ] = ( ) Const conpi=3.141592 2) ( ) Const conpi2=conpi*3 17
11. (1) : (+, -, *, /), ^( ), \( ), Mod( ), &( ) ( ) MyValue=10 Mod 3 1 MyValue=11\4 2 (2) : - <, <=, >, >=, =, <>( ), Like - - Like a) : 1 Like 2 b) 1 2, True False 18
c). *: ( : a*a).?: ( : a?a). #: ( : a#a). [ 1-2 ] : ( : [a-z]). [! 1-2]: ( : [!a-z]). [ ]: ( : a[*]a) d). ABCD Like AB* -> True. BA Like?A -> True. 1A Like #A -> True. A Like [A-Z] -> True. A Like [!A-Z] -> False 19
. a*a Like a[*]a -> True (3) : Not( ), And( ), Or( ), Xor( ), AndAlso( ), OrElse( ) ( p. 107 ) (4) : - : = - : +=, -=, *=, /=, \=, &= ( ) icount=icount+2 icount+=2 strmystring &= Hello 20
( : pp. 248~268) 1.? ( => => ) 2. 1) (Debugging) 2) 3. 1)Sub : 2)Function :, 21
3) : 4. Sub (1) 1) [Public Protected Friend Protected Friend Private] Sub ([ ]) End Sub (2) Private : Sub (3) Public : Sub 22
(4) Protected : (5) : Sub Sub 1) [Optional][ByVal][ByRef][ParamArray] [()] [As ] [= ] - ByVal : (a) (b) Sub (c) (d)( ) (p. 261 ) Sub Main_Procedure() Dim n As Integer 23
n=3 Call A_Procedure(n) Debug.WriteLine(n) End Sub Sub A_Procedure(ByVal n As Integer) n=n+1 End Sub - ByRef : (Default) (a) (b) Sub (c) ( ) ByVal (d)( ) (p. 262 ) 24
Sub Main_Procedure() Dim A,B As Integer A=3 : B=5 Call Swap(A,B) Debug.WriteLine(A & & B) End Sub Sub Swap(A, B As Integer) Dim Temp As Integer Temp=A: A=B: B=Temp End Sub - Optional : 25
(a) (b) [= ] (c) ParamArray (d)( ) (p. 266 ) A_Procedure(, ) A_Procedure(,) Sub A_Procedure(X As String, Optional Y As String= ) Debug.WriteLine(X & Y) End Sub - ParamArray : (a) ( ) (b)byref, Optional 26
(c) For Each ~ Next object (d)( ) (p. 267 ) Debug.WriteLine(Max(1,2)) Debug.WriteLine(Max(1,2,3,4)) Function Max(ByVal ParamArray Nums()) As Object Dim i As Object Max=Nums(0) For Each i In Nums If i > Max Then Max=i Next i End Function 27
5. Sub (1) : Sub 1) Private Sub _ ( ) End Sub (2) : Sub 6. Sub 1) [Call] ([ ]) 7. Function (1) 28
1) [Public Protected Friend Protected Friend Private] Function ([ ]) [As ] - Sub (Default: Public) - [As ]: Function, (Default: object ) (2) \ (3) Function 1) [Call] ([ ]) (4) ( ) (p. 255 ) Debug.Writeline(Sum(5,3)) Debug.WriteLine(5+Sum(2,3)) 29
Function Sum(ByVal A As Integer, ByVal B As Integer) As Integer Sum=A+B End Function (5) : System.Math (p. 256 ) 8. / / (1) 1) [ ]. ([ ]) 2) (p. 260 ) Public Module MyModule1 Sub MyProcedure() MyModule2.MyProcedure() 30
End Sub End Module Public Module MyModule2 Sub MyProcedure() End Sub End Module (2) / 1) /. ([ ]) 2) (pp. 259~260 ) - Dim MyClassA As New ClassA 31
MyClassA.MyProcedure() - Dim MyStruc As StructA MyStruc.MyProcedure() 32
- :, - ( ): ( : pp. 224~247) 1.IF (1) IF : 1) If Then End If 33
If Then 2) If Number >100 Then Number=100 Debug.WriteLine(Number) End If (2) If Then Else - 1) If 1 Then 1 ElseIf 2 Then 2 34
Else 3 End If 2) - ElseIf 1, 1 True 1 False 3 - Else 2, 1 True 1, 2 True 2, False If Jumsu >=95 Then Debug.WriteLine( A+ ) ElseIf Jumsu>=90 And Jumsu <95 Then Debug.WriteLine( A ) 35
ElseIf Jumsu>=85 And Jumsu <90 Then Debug.WriteLine( B+ ) ElseIf Jumsu>=80 And Jumsu <85 Then Debug.WriteLine( B ) ElseIf Jumsu>=75 And Jumsu <80 Then Debug.WriteLine( C+ ) ElseIf Jumsu>=70 And Jumsu <75 Then Debug.WriteLine( C ) Else Debug.WriteLine( D ) Endif 2.Select Case : 36
(1) Select Case Case 1 1 Case 2 2 Case Else End Select - Case 1) Case 1 To 4: To 2) Case 1,3,5: 37
3) Case Is > 10: Is (2) Dim Number As Integer Number=8 Select Case Number Case 1 To 5 Debug.Print Between 1 and 5 Case 6,7,8 Debug.Print Between 6 and 8 Case Is >8 And Number <11 Debug.Print Greater than 8 Case Else Debug.Print Not Between 1 and 10 38
End Select 3.Try Catch Finally : (1) Try Catch Finally Catch End Try ( ) Try a=b\c 39
Catch a=0 Finally Debug.WriteLine(a) End Try (2) Finally (3) Catch ( ) Catch When (Catch When Err.number=11) Catch As Exception (Catch er As Exception) Catch As Exception When (Catch er As Exception When Err.number=11) (4) Exit Try : Try ; Finally Try 40
(5) Throw : ( ) Throw( ) 4.For Next : (1) For = To [Step ] Next - <, :, <= >, Next - >, : 41
(2), >= <, Next - = ( - )/ + 1 ( ) For Count=1 To 10 Debug.WriteLine(Count) Next Count Debug.WriteLine(Count) (3) For : Exit For For Next For a=1 To 10 For b=1 To 10 42
If a=b Then Debug.WritelLine(a*b) Exit For End if Next b Debug.Writeline( ) Next a 5.For Each Next (1) - For Each In 43
Next (2) - object - collection Dim strdata(1 To 3) As String Dim vdata As Object Dim I As Integer For I=1 To 3 StrData(I)= = + CStr(I) Next I For Each vdata In strdata Debug.WriteLine(vData) Next vdata 44
6.Do - (1)Do While Loop (While End While ) - True False 1) Do While Loop 2) Count=1 Do While Count <= 10 45
Debug.WriteLine(Count) Count=Count+1 Loop (2)Do Until Loop - True True 1) Do Until Loop 2) Count=1 Do Until Count > 10 46
Debug.WriteLine(Count) Count=Count+1 Loop (3)Do Loop While - While, True 1) Do False Loop While 2) Count=1 Do 47
Print Count Count=Count+1 Loop While Count <= 10 (4)Do Loop Until - Until, True 1) Do True Loop Until 2) Count=1 Do 48
Debug.WriteLine(Count) Count=Count+1 Loop Until Count > 10 (5)Exit Do 1) - Do Dim Check, Count Check=True: Count=0 Do Do While Count < 20 Count=Count + 1 If Count = 10 Then Check=False 49
Exit Do End If Loop Loop Until Check=False 7.Goto 1) - Goto : -, 50
8.On Error GoTO - 1) (Resume Next ) On Error GoTo.. ( ).. : ( ) Resume Next 51
- - :, ( : pp. 269~281) 1. ( ) (1) : Dim ( ) As - : - : (2) - - ( ) 52
(a) Dim ave(3) As integer ave(0)=10 : ave(1)=20 : ave(2)=30 Dim ave( ) As Integer ={10,20,30} (b) Dim student(2, 2) As integer ave(0,0)=10 : ave(0,1)=20 : ave(1,0)=30 : ave(1,1)=40 Dim student(, ) As Integer={{10,20},{30,40}} 2. - - - 53
(1) - : Dim ( ) As (2) Redim - - - ( )Dim mat() As Integer Sub A_Procedure() Redim mat(3,4) End Sub - Redim 54
- Preserve ( ) Redim Preserve mat(3,5) ( ) ( ) Ubound : Ubound( [, ]) : Ubound(mat,1), Ubound(mat,2) 3. -, (1) : Erase 55
( : pp. 112~221) 1. (1) : Visual Basic, (2) : (3) X : Microsoft 2. (1) (Label) - - Text 56
1) - Text :, & - BorderStyle : - AutoSize : - UseMnemonic : & 2) - (2) (LinkLabel) - 1) - LinkArea : - LinkColor : 57
- VisitedLinkColor : - LinkVisited : VisitedLinkColor - ActiveLinkColor : - LinkBehavior :, AlwaysUnderline/HoverUnderline/NeverUnderline - Text : 2) - : System.Diagnostics Process Start ( ) Imports System.Diagnostics Process.Start( http://www.suwon.ac.kr ) (3) (TextBox) -, 58
1) - Locked : - Text : - Multiline :, Ctrl+Return ( ) Sub Form_Load( ) Text1.Text=. & vbcrlf & _. End Sub - ScrollBars :, None/Horizontal/Vertical/Both - SelectionStart : - SelectionLength : - WordWrap : 59
3. (1) (Button) 1) - AcceptButton : Enter - CancelButton : Esc - BackgroundImage /Image : - ImageAlign :, / / / / 2) - - space bar enter 60
- (2) (CheckBox) - 1) - Checked : - CheckState : Checked/UnChecked/Indeterminate( ) - ThreeState : Indeterminate - AutoCheck : V (3) (RadioButton) - 1) - Checked : - Enabled : 61
(4) (GroupBox) - - (5) (Panel) - (6) (ListBox) (ComboBox) - 1) - ( ); ( ) - :, ( ), ( ) 62
2) - Items.Add(item) : - Items.Insert(index,item): - Items.Remove(item)/Items.RemoveAt(index): - Items.Clear(): 3) - Sorted : - SelectedItem : - SelectedIndex : index, - Items.Count : - MultiColumn :, True( )/False( ) 63
- SelectionMode :, None/One/MultiSimple/MultiExtended (7) (CheckedListBox) - 1) - Items() : 2) - GetItemChecked(index): - SetItemChecked(index, True/False): / (8) (DomainUpDown) - / (9) (NumericUpDown) - 64
(10) (Scroll Bar) 1) - Change : - Scroll : 2) - Value : - Min, Max : Value ( ) - SmallChange : - LargeChange : (11) (Timer) - (12) (PictureBox) -, bmp,ico,gif,jpg 65
- Image FromFile ( ) Image.FromFile( C:\MyCar.bmp ) 4. (1) (ProgressBar) - 1) - Value : - Min(Max) : ( ) (2) (ToolBar) - 1) 66
- ImageList :, Image - Appearance : (Flat/Normal) - Buttons :, ToolBarButton Style : (PushButton/ToggleButton/Seperator/ DropdownButton) ImageIndex : Text : - ButtonClick : e Button, (Text ), (ImageIndex ) (3) (StatusBar) 67
- 1) - ShowPanels :, - Text :, ShowPanels False - Panels :, StatusBarPanel Item : (4) (TabControl) - 1) - TabPages :, TabPage - Alignment : (Top/Bottom/Left/Right) 68
(5) (ListView) 1) : LargeIcon, Smallicon, List, Details 2) View : Items :, ListViewItem Columns :,, (Left/Center/Right), ColumnHeader SmallImageList : ImageList (SmallIcon/List/Details ) LargeImageList : ImageList (LargeIcon ) 3) AfterLabelEdit : 69
, e Item (Integer ) Label (String ) (6) (TreeView) : 1) Nodes :, TreeNode TopNode : SelectedNode : FirstNode( ), LastNode( ), NextNode( ), PrevNode( ) Parent( ) 2) AfterSelect :, e Node Index, Text (7) (NotifyIcon): 70
1) Icon : Icon Text : (8) (Tooltip) 1) Active : InitialDelay / Reshowdelay / AutoPopDelay 2) SetToolTip : (9) (TrackBar) : 1) TickFrequency : TickStyle : (None/TopLeft/BottomRight/Both) (10) (DateTimePicker) 71
1) Format : (Long/Short/Custom) CustomFormat : MyDateTimePicker.Format=Custom DateTimePicker.CustomFormat= yyyy MMM dd ddd DateTimePicker.CustomFormat= : yy MM d HH:mm:s ddd 5. X (1) (MaskedEdBox) : 1) Mask : #, 72
PromptInclude : PromptChar CtlText : (2) MS (MSChart) : 2 3,, 1) Title.Text : Plot.Axis(MSChart20Lib.VtChAxizId.VtChAxisIdX).AxisTitle.Text : X Plot.Axis(MSChart20Lib.VtChAxizId.VtChAxisIdY).AxisTitle.Text : Y Legend.Location.Visible : Legend.Location.LocationType : 73
ChartData : 74
( : pp. 284~316) 1. (1) : Class / / /.. End Class ( ) Class CCar End Class (2) : ( (instance) ) 75
Dim As New ( ) Dim As =New ( ) ( ) Dim My_Car As New CCar() 2. :, (1) (2). (3) Class CCar Dim m_x, m_y As Integer End Class Dim My_Car As New CCar() My_Car.m_x=100 76
3. Dim icurx As Integer=My_Car.m_x (1) Property () As Set (ByVal value As ) End Set Get End Get End Property (2), (3) Class CCar 77
Private m_x As Integer Property CarX() As Integer Set (ByVal x As Integer) m_x=x End Set Get Return m_x End Get End Property End Class Dim My_Car As New CCar() My_Car.CarX=100 Set End Set, m_x 100 Dim icurx As Integer=My_Car.CarX Get End Get, icurx 78
(4) ReadOnly WriteOnly : (Get End Get ) (Set End Set ), ReadOnly( WriteOnly) (5) Default :,,, Default 1) Class CCar Private m_x(2) As Integer Default Property CarX(ByVal index As Integer) As Integer Set (ByVal value As Integer) m_x(index)=value End Set 79
Get Return m_x(index) End Get End Property End Class Dim My_Car As New CCar() My_Car(0)=100: My_Car(1)=150 icurx1=my_car(0): icurx2=my_car(1) 4. :, Sub Function (1) Class CCar Private m_x As Integer 80
Sub SetX(ByVal x As Integer) m_x=x End Sub Fuction GetX() As Integer Return m_x End Function End Class Dim My_Car As New CCar() Dim icurx As Integer My_Car.SetX(5) icurx=my_car.getx() 5. : 81
(1) : WithEvents 1) Private WithEvents My_Car As New CCar (2) 1) : Event ( ) : Public Event Event_Draw(ByVal ipos As Integer) 2) : RaiseEvent ( ) : Class CCar Public Event Event_Draw(ByVal ipos As Integer) Sub Draw(ByVal ipos As Integer) RaiseEvent Event_Draw(0) End Sub End Class 82
(3) : Sub Handles ; AddHandler 1) ( Handles ) Private Sub OnDraw(ByVal ipos As Integer) Handles My_Car.Event_Draw Debug.WriteLine(iPos) End Sub 2) ( AddHandler ) Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load AddHandler My_Car.Event_Draw, AddressOf OnDraw End Sub Private Sub OnDraw(ByVal ipos As Integer) 83
Debug.WriteLine(iPos) End Sub 6. ( ) ( ) (1) (constructor):, (overloading) 1) Class Sub New( ) End Sub End Class 2) Class CCar Sub New() 84
Debug.WriteLine(. ) End Sub Sub New(ByVal inum As Integer) Debug.WriteLine( & inum &. ) End Sub End Class Dim My_Car As New CCar() Dim My_Car As New CCar(1) (2) (destructor): 1) Class Protected Override Sub Finalize() End Sub 85
End Class 2) Nothing, ( ) Finalize, System.GC.Collect() 86
( : pp. 317~354) 1. : 2. : (sub class) Inherits (base class) (1) Class MyParentClass Public imyparentvalue As Integer End Class Class MySubClass Inherits MyParentClass 87
Public imysubvalue As Integer End Class Dim obj As New MySubClass() obj.imyparentclass=5 obj.imysubclass=10 (2) : MustInherit 1) MustInherit Class MyParentClass End Class 3. (overriding): ; overridable, overrides 88
(1) Class MyParentClass Public Overridable Sub Hello() End Sub End Class Class MySubClass Inherits MyParentClass Public Overides Sub Hello() End Sub End Class Dim obj As New MySubClass() Dim obj2 As New MyParentClass() obj.hello() Sub Class 89
obj2.hello() Base Class (2) : p. 324 ; New (3) : ; Shadows 1) Class MyParentClass Public Sub Hello() End Sub End Class Class MySubClass Inherits MyParentClass 90
Public shadows Sub Hello() End Sub End Class Dim obj As MySubClass = New MySubClass() obj.hello() Sub Class 2) : p. 330 ; As (4) : MustOverride 4. (1) : ( ) (2) : 91
MyBase 1) Class MyParentClass Public Sub New() End Sub Public Sub New(ByVal strname As String) End Sub End Class Class MySubClass Inherits MyParentClass Public Sub New(ByVal strname As String) {MyBase.New(strName)} 92
End Sub End Class Dim obj As MySubClass = New MySubClass( Hi. ), {.. } 5. (1) :, (2) Class MyParentClass Public Event MyParentEvent() Protected Sub DoEvent() RaiseEvent MyParentEvent() 93
End Sub End Class Class MySubClass Inherits MyParentClass Public Sub Hello() DoEvent() End Sub End Class Public Class Form1 Private Sub OnMyEvent() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 94
Dim obj As MySubClass=New MySubClass() AddHandler obj.myparentevent, AddressOf OnMyEvent obj.hello() End Sub End Class 6. Me/MyBase/MyClass (1) Me : 1) Class CCar Private strname As String Sub Hello() Dim strname As String 95
strname= A Me.strName= B End Sub End Class (2) MyBase : 1) Class MyParentClass Public Overridable Sub Hello() End Sub End Class Class MySubClass Inherits MyParentClass Public Overides Sub Hello() 96
MyBase.Hello() End Sub End Class Dim obj As MySubclass=New MySubClass() obj.hello() Hello (3) Myclass : 1) Class MyParentClass Public Sub DoSomething() Hello() {MyClass.Hello()} End Sub Public Overridable Sub Hello() End Sub 97
End Class Class MySubClass Inherits MyParentClass Public Overides Sub Hello() End Sub End Class Dim obj As MySubclass=New MySubClass() obj.dosomething() Hello, {.. } Hello 98
( : pp. 355~398) 1.? is-a - 2.? is-a act-as A B (A act-as B) 3. (1) Interface End Interface (2),,, (3), (4) 99
Public Interface IObject Function GetMyValue() As Integer End Interface Class MyParentClass Implements IObject Private MyValue As Integer=5 Public Function GetMyValue() As Integer Implements IObject.GetMyValue Return MyValue End Fuction End Class MyParentClass act-as IObject 4.? (1) (early)/ (late) 100
1) : 2) : Public Class CEarlyBindClass Public Sub hello End Sub End Class Dim obj As New CEarlyBindClass obj.hello() hello() Option Strict Off Public Class CLateBindClass 101
Public Sub hello End Sub End Class Public Sub DoIt(ByVal obj As Object) obj.hello() End Sub (Option Strict On ) Public Sub DoIt(ByVal obj As Object) Dim localobj As CLateBindClass localobj=ctype(obj,clatebindclass) obj CLateBindClass localobj.hello() hello() 102
End Sub (2) 1) 2) 3) 5.? (1) Private: (2) Protected: (3) Friend: (4) Public: 6.?,, shared, (1),,, 103
7. :, Delegate (1) Public Class Form1 Public Delegate Sub MyDelegate(ByVal message As String) Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim NewHello As New MyDelegate(AddressOf CMyClass.Hello) NewHello( ) End Sub End Class Class CMyClass Public Shared Sub Hello(ByVal message As String) 104
End sub End Class 8. (1) :,,,, 1) 2) Structure End Structure Structure Person Public name As String Public score As Integer End Structure 105
(2) : 1) Enum [As ] 1 [= ] 2 [= ] End Enum 106
( : pp.400~411) 1. : 2. : (1) (2) (3) Text (-) (4) ( ), Alt (5) ( ), Ctrl, 107
(6) 5 (7) Gray Enabled False (8) Checked True (9) RadioCheck True (10) ( ) 3. : (1) 108
(2) ContextMenu (3) 109
( : pp. 412~442) 1. : 2. (1) 1), 2) MyForm.ShowDialog() ( : ShowDialog(Hide) Visual True(False) ( ) ) 110
(2) 1) 2) MyForm.Show() 3. (1)InputBox, MsgBox (2) (3) 4. InputBox, MsgBox : (1)InputBox 1) : InputBox ( [, ] [, ] ) - < >, < > 2) 111
FileName=InputBox(, ) FileName=InputBox(,, *.txt ) (2)MsgBox 1) : MsgBox ( [, ] [, ] ) (p. 414 ) 2) Msg =. Style = MsgBoxStyle.OKOnly Title = Response = MsgBox(Msg, Style, Title) 5. (1) 112
1) Windows 2) (2) 1)Text : 2)FromBorderStyle : (FixedSingle) 3)MaxButton : ( ) (False) 4)MinButton : ( ) (False) 5)ControlBox : (False) (3) 1) : Dim MyForm As frmmain = New frmmain() 2) : Close 113
(4) :, 6. (1) ( ) :,,,, OpenFileDialog(SaveFileDialog) ShowDialog 1) (p. 431 ) 2) cdgopen.filter = (*.*) *.* (*.txt) *.txt (2) :, ColorDialog ShowDialog (3) :,,,, FontDialog ShowDialog 114
(4) :, FolderBrowserDialog ShowDialog (5) :, PrintDialog ShowDialog, PrintPreviewDialog, PageSetupDialog, PrintDocument 115
( : pp. 508~530) 1. : /, ANSI (American National Standards Institute) (1) : 1) : FileOpen (,, [, ] [, ]) :, FreeFile : OpenMode.Input/Output/Append :, OpenAccess.Read/Write/ReadWrite :, 116
2) OpenShare.LockRead/LockReadWrite/Shared Dim ifilenum As Integer ifilenum=freefile() FileOpen(iFileNum, MyFile.Fil,OpenMode.Output) (2) : 1) : FileClose( ) (3) : OpenMode.Input 1) : Input(, ) 2), 1, 117
Input(iFileNum,strName): Input(iFileNum,strNumber): Input(iFileNum,strDept) (4) : OpenMode.Output OpenMode.Append 1) : WriteLine(, 1, 2, ) (,) 2) Dim strstring As String, inumber As Integer strstring= Hello inum=12345 WriteLine(iFileNum,strString,iNum) 2. : ( ) (1) 118
1) : FileOpen(,, [, ][, ][, ]) : OpenMode.Random : 2) Public Structure SPerson <VBFixedString(10)> Public strname As String <VBFixedString(10)> Public strnum As String <VBFixedString(10)> Public strdept As String End Structure Private m_ifilenum As Integer Private Person As SPerson ifilenum=freefile() FileOpen(iFileNum, MyFile.Fil,OpenMode.Random,,,Len(Person)) 119
(2) 1) : FileGet(, [, ]) 2) FileGet(iFileNum,Employee,iPosition) (3) 1) : FilePut(, [, ]) 2) LastRecord=LastRecord+1 FilePut(iFileNum,Emplotee,LastRecord) 3. :,, 120
(1) 1) : FileOpen(,, [, ][, ]) : OpenMode.Binary \ (2), 121