¤ÀÃþ |
¼ÐÃD |
¤j·N |
§@ªÌ |
¤é´Á |
ª«¥ó¶°¦X | ¥Î TypeOf §PÂ_¾Þ§@«ü©w«¬ºA¤§ Control | ¡@ | ¦Ñ©Ç | 1999/5/18 |
ª«¥ó³B²z | CheckBox.Value ªºª¬ºAÈ | ¡@ | ¦Ñ©Ç | 1999/7/5 |
¹Ï§Î³B²z | ²©ö²Îp¹Ïªí¼ÒÀÀ | Scale ¤èªkªº¨Ï¥Î | ¦Ñ©Ç | 1999/5/21 |
¹Ï§Î³B²z | ¨Ï¹Ï¤ùÅÜ·t»PÅÜ«G | PaintPicture OpCode °Ñ¼Æªº®ÄªG | ¦Ñ©Ç | 1999/5/30 |
¹Ï§Î³B²z | Åý¹Ï¤ùÀH¾÷¥X²{ | ¡@ | ¦Ñ©Ç | 1999/6/1 |
¹Ï§Î³B²z | ¨ú±o¹ÏÀɸê°T | Picture ª«¥óªº¨Ï¥Î | ¦Ñ©Ç | 1999/7/8 |
µøµ¡¬É± | ¦p¦ó±oª¾ MDIForm ªº¤lªí³æ³£¤w Cancel | ·í Forms.Count=1 | ¦Ñ©Ç | 1999/5/26 |
ÀÉ®× I/O | ¥Î Print # ¿é¥X¤£¥[ vbCRLF µ²§Àªº¦r¦ê | [;] ²Å¸¹ªº§®¥Î | æ£æ£ | 1999/5/30 |
ÀÉ®× I/O | ²©öÀɮ׫O¥þ½s½X¸Ñ½X½d¨Ò | tt±o¥¿ªº Xor ¹Bºâ§®¥Î | ¦Ñ©Ç | 1999/6/14 |
¨ç¼Æ³B²z | ¦Û»s MsgBox ¹ï¸Ü®Ø | ¤½¥Î¼Ò²Õ(Module) ªº§Q¥Î | ¦Ñ©Ç | 2000/5/17 |
Shinji ¼¶¼g©ó¤å³¹
¦³¤@µ{¦¡¤º¦³ 50 Ó textbox ¨Ñ user ¿é¤J¼Æ¦r,¦p¦ó¥i¥Hª¾¹D 50 ӼƦr¤¤¨ºÓ³Ì¤j¨ºÓ³Ì¤p©O?50Ó¨º»ò¦h,ø¦n¥s§Ú¤@Ó¤@Ó¤ñ¸û§r!
¦Ñ©Çµª¡G
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5535
ClientLeft = 60
ClientTop = 345
ClientWidth = 7395
LinkTopic = "Form1"
ScaleHeight = 5535
ScaleWidth = 7395
StartUpPosition = 3 '¨t²Î¹w³]È
Begin VB.CommandButton Command2
Caption = "Command2"
Height = 495
Left = 4800
TabIndex = 5
Top = 4080
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 495
Left = 4800
TabIndex = 4
Top = 3240
Width = 1215
End
Begin VB.TextBox Text1
Height = 495
Index = 2
Left = 5160
TabIndex = 3
Top = 1920
Width = 1575
End
Begin VB.TextBox Text1
Height = 495
Index = 1
Left = 5160
TabIndex = 2
Top = 1200
Width = 1575
End
Begin VB.TextBox Text1
Height = 495
Index = 0
Left = 5160
TabIndex = 1
Top = 480
Width = 1575
End
Begin VB.PictureBox Picture1
BackColor = &H80000009&
Height = 4935
Left = 360
ScaleHeight = 4875
ScaleWidth = 3195
TabIndex = 0
Top = 360
Width = 3255
End
Begin VB.Label Label1
Caption = "²Ä¤T¦¸¦¨ÁZ"
Height = 375
Index = 2
Left = 3960
TabIndex = 8
Top = 2040
Width = 975
End
Begin VB.Label Label1
Caption = "²Ä¤G¦¸¦¨ÁZ"
Height = 375
Index = 1
Left = 3960
TabIndex = 7
Top = 1320
Width = 975
End
Begin VB.Label Label1
Caption = "²Ä¤@¦¸¦¨ÁZ"
Height = 375
Index = 0
Left = 3960
TabIndex = 6
Top = 480
Width = 975
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'¥»½d¨Ò¦b§Q¥Î PictureBox ¦Ûq®y¼Ð¤èªk¡A»s§@²³æªº Chart ¥\¯à¡C
Option Explicit
Private Sub Command1_Click()
Dim I As Long
Picture1.Cls
'°õ¦æµe®æ½u¦Ûq¨ç¼Æ
GridDraw
Picture1.DrawWidth = 3
For I = 0 To 1
'¨Ì TextBox ¿é¤J¼ÆÈ¡Aµe X,Y §é½u
Picture1.Line (3 + (I) * 2, Val(Text1(I).Text))- _
(3 + (I + 1) * 2, Val(Text1(I + 1).Text)) _
, QBColor(Int(Rnd * 16))
Next
Picture1.DrawWidth = 1
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Command1.Caption = "ø¦¨ÁZ¦±½u"
Command2.Caption = "µ²§ô"
'¦Ûq®y¼Ð¨è«×¡AX ¶b 0~8¡AY ¶b 100~-20¡C
Picture1.Scale (0, 100)-(8, -20)
Randomize
End Sub
Private Sub Picture1_Paint()
GridDraw
End Sub
Private Sub GridDraw()
Dim I As Long
'µe X ¶b
Picture1.Line (1, 0)-(8, 0)
'µe Y ¶b
Picture1.Line (1, 100)-(1, 0)
'µe X ¶b¨è«×
For I = 0 To 2
Picture1.CurrentX = 2 + I * 2
Picture1.CurrentY = -5
Picture1.Print "²Ä" & CStr(I + 1) & "¦¸"
Next
'µe Y ¶b¨è«×
For I = 0 To 9
Picture1.CurrentX = 0
Picture1.CurrentY = (I + 1) * 10
Picture1.Print CStr((I + 1) * 10)
Next
End Sub
¤p±j¥§ ¼¶¼g©ó¤å³¹
½Ð°Ý§Ún«ç»òª¾¹DMDIForm ªºchild form ¤w¸g¥þ³Qcancel ¤F©O???
¦Ñ©Çµª¡G
·í Forms.Count=1 ¡Aªí¥Ü©Ò¦³ ChildForm ³£³Q Cancel¡C
(¤j¤jªº²´·ú....) ¦b programming ª©´£¨ì
¬°¤°»ò Print # ªº¿é¥XÁ`¬O·|¦bÀÉ®×¥½ºÝ¥[¤JCR©MLF ³Â·Ðª¾¹Dªº¤Hmail¤@¤U....ÁÂÁÂ!!
æ£æ£µª¡G
¤£n cr+lf ´N¥[ ";"¡APrint #hFileHandle, Var ´N¤£·|¦³¤À¬q²Å¸¹¡C
¦Ñ©Ç¸É¡G
Private Sub Command1_Click()
Dim Var As String
Dim FileHandle As Integer
FileHandle = FreeFile
Open "c:\temp\test.txt" For Output As #FileHandle
Var = "a"
Print #FileHandle, Var;
Var = "b"
Print #FileHandle, Var;
Var = "c"
Print #FileHandle, Var;
Close #FileHandle
End Sub
'½d¨Ò¥\¯à¡G¥Î¶Â¥Õ®æ½u¹Ï·í¾B¸n¹Ï¡A¨Ïµe±©ú·t¤Æ¡C
'¨Ï¥Î±±¥ó¡GPicture1,Picture2¡BCommand1,Command2,Command3
Option Explicit
Private Sub Command1_Click()
Picture1.Cls
'¥Î vbSrcAnd ªº¤èªk¶K¾B¸n¹Ï¡A·|¨Ï¾B¸n¹Ï¶Â¦â³¡¥÷³Q¾B»\¡A¦ý¾B¸n¹Ï¥Õ¦â
'³¡¥÷«hºû«ùì¹Ï¼Ë¡C¤]´N¬OÅý³Q¶K¤Wªº¹Ï¤@¥bªº¹Ï¯ÀÅܦ¨¶Â¦â¡A
'¹F¦¨·t¤U¨Óªº®ÄªG
Picture1.PaintPicture Picture2.Image, 0, 0, , , , , , , vbSrcAnd
End Sub
Private Sub Command2_Click()
Picture1.Cls
'¥Î vbSrcPaint ªº¤èªk¶K¾B¸n¹Ï¡A·|¨Ï¾B¸n¹Ï¶Â¦â³¡¥÷¤£§ïÅÜ¡A¦ý¾B¸n¹Ï¥Õ¦â
'³¡¥÷«h³Q¾B»\¡C¤]´N¬OÅý³Q¶K¤Wªº¹Ï¤@¥bªº¹Ï¯ÀÅܦ¨¥Õ¦â¡A
'¹F¦¨«G°_¨Óªº®ÄªG
Picture1.PaintPicture Picture2.Image, 0, 0, , , , , , , vbSrcPaint
End Sub
Private Sub Command3_Click()
Picture1.Cls
End Sub
Private Sub Form_Load()
Dim I As Long
Command1.Caption = "ÅÜ·t"
Command2.Caption = "ÅÜ«G"
Command3.Caption = "¦^´_"
Picture1.AutoSize = True
'´£¨Ñ¶Â¥Õ®æ½u¹Ï¤§¥Î¡A¤£¶·Åã¥Ü¡C
Picture2.Visible = False
Picture1.Picture = LoadPicture("d:\image\03.jpg")
'Scale §ï¦¨¹Ï¯À¥H§Q¹º½u
Picture2.ScaleMode = 3
'§ï¦¨¥Õ©³¶Â½u
Picture2.BackColor = RGB(255, 255, 255)
Picture2.ForeColor = RGB(0, 0, 0)
With Picture2
.Width = Picture1.Width
.Height = Picture1.Height
End With
Picture2.AutoRedraw = True
'µeª½½u
For I = 0 To Picture2.ScaleWidth - 1 Step 2
Picture2.Line (I, 0)-(I, Picture2.ScaleHeight)
Next
'µe¾î½u
For I = 0 To Picture2.ScaleHeight - 1 Step 2
Picture2.Line (I, 0)-(I, Picture2.ScaleWidth)
Next
Picture2.AutoRedraw = False
End Sub
¤£·|´åªaªº³½ ¼¶¼g©ó¤å³¹
§Ú·Q½Ð°Ý¤@¤U..¦p¦ó§Q¥Îvb¤¤ªº¹Ï¤ù±±¨î°}¦C..Åý¹Ï¤ù¯àÀH¾÷¥X²{..
¦Ñ©Çµª¡G
Dim Pic(2) As Picture
Set Pic(0)=LoadPicture("a.bmp")
Set Pic(1)=LoadPicture("b.bmp")
Set Pic(2)=LoadPicture("c.bmp")
Randomize
Set Image1.Pictrue=Pic(Int(Rnd*3))
¦n¤jªºÃú ¼¶¼g©ó¤å³¹
§Ú¼g¤F¤@Ó³q°T¿ýªºµ{¦¡,§â©Ò¦³¸ê®Æ¦s¤J"DATA.DAT"ÀÉ,¦ý¥Î"WordPad"§Y¥i¬Ý¨ì·í¤¤ªº¸ê®Æ,½Ð°Ý¥i¥H±N¸ê®ÆÂন¶Ã½X©Î¨ä¥¦«¬¦¡¦A¦s¤JÀɮפ¤¹F¨ì«O±Kªº®ÄªG¶Ü ?
¦Ñ©Çµª¡G
'½d¨Ò¥\¯à¡G±N¤å¦rÀɮ׫½s½X¡A¥H¹F¦¨Àɮ׫O¥þªº®ÄªG¡C
'°ò¥»¹B§@ì²z¡G
'1.«O¥þ±K½X¤£¬O¥Ñµ{¦¡¹Bºâ²£¥Í¡A¦Ó¬O®³¥ô·N¤@±i¹Ï¤ù·í±K½X¡A¤]´N¬OÁa¨Ï§O¤HÀò±o
'¥»½d¨Òªº Source Code ¡A¦pªG¤£ª¾¹D§A¥Îªº¬O¨º±i¹Ï¤ù¡A±K½XÁÙ¬O¸Ñ¤£¥X¨Ó¡C
'2.¥Ñ©ó¹Ï¤ù¬O¦b³]p¶¥¬q´N³]©w¦b PictureBox ªº Picture ÄÝ©ÊùØ¡A©Ò¥HµwºÐ¤¤¤£·|
¦³
'¸Ó¹Ï¤ùªºÀɮסC
'°õ¦æ¥»½d¨Ò½Ð©óªí³æ¤W¥¬¸m CommonDialog1¡BCommand1,2¡BText1 µ¥±±¨î¶µ¡A¨Ã¦b
'³]p¶¥¬qÅý Picture1.AutoSize=True «á³]©w¤@¤j¤p¾A¤¤ªº¹Ï§Î¡C
Option Explicit
'±N¹Ï¤ùÀɸê®Æ¸ü¤J¹Bºâ¤§°}¦C
Dim SecretBuff() As Byte
Private Sub Command1_Click()
Dim FileHandle As Integer
'¤å¦rÀɸê®Æªº¦s©ñ°}¦C
Dim DataBuff() As Byte
Text1.Text = ""
CommonDialog1.filename = ""
CommonDialog1.ShowOpen
If CommonDialog1.filename = "" Then
Exit Sub
End If
'¸ü¤J¥[±K«áªº¤å¦rÀÉ
FileHandle = FreeFile
Open CommonDialog1.filename For Binary As #FileHandle
ReDim DataBuff(LOF(FileHandle) - 1)
Get #FileHandle, , DataBuff
Close #FileHandle
'±N¥[±K¤å¦rÀÉ°e¨ì<<¸Ñ±K¦Ûq¨ç¼Æ>>¤¤¸Ñ±K
Text1.Text = ChangeToShowType(DataBuff, SecretBuff)
End Sub
Private Sub Command2_Click()
Dim FileHandle As Integer
Dim DataBuff() As Byte
CommonDialog1.filename = ""
CommonDialog1.ShowSave
If CommonDialog1.filename = "" Then
Exit Sub
End If
'±N¤å¦rÀÉ°e¨ì<<¥[±K¦Ûq¨ç¼Æ>>¤¤¥[±K
ChangeToSecretType DataBuff, SecretBuff, Text1.Text
Kill CommonDialog1.filename
'±N¥[±K¹L«áªº¦ì¤¸²Õ°}¦C¦sÀÉ
FileHandle = FreeFile
Open CommonDialog1.filename For Binary As #FileHandle
Put #FileHandle, , DataBuff
Close #FileHandle
'¨Ï¦sÀɯ墯à
Command2.Enabled = False
End Sub
Private Sub Form_Load()
Dim FileHandle As Integer
Command1.Caption = "¶}±ÒÀÉ®×"
Command2.Caption = "Àx¦sÀÉ®×"
Command2.Enabled = False
CommonDialog1.Filter = "Special Data(*.Dat)|*.dat|¥þ³¡ÀÉ®×(*.*)|*.*"
'¤£Åã¥Ü±K½X¹Ï¤ù
Picture1.Visible = False
'±N±K½X¹Ï¤ù¦s¦¨¼È¦sÀÉ
SavePicture Picture1.Picture, App.Path & "\~" & App.Title & ".tmp"
'±N¹Ï¤ùÀɸü¤J±K½X°}¦C
FileHandle = FreeFile
Open App.Path & "\~" & App.Title & ".tmp" For Binary As #FileHandle
ReDim SecretBuff(LOF(FileHandle) - 1)
Get #FileHandle, , SecretBuff
Close #FileHandle
'§R°£±K½X¹Ï¤ù¼È¦sÀÉ
Kill App.Path & "\~" & App.Title & ".tmp"
End Sub
Private Sub Text1_Change()
'¶}±Ò¦sÀÉ¥\¯à
Command2.Enabled = True
End Sub
'¸Ñ±K¦Ûq¨ç¼Æ
'°Ñ¼Æ»¡©ú¡G
'1.ChangeBuff():n³Q¸Ñ±KªºÀÉ®×°}¦C
'2.MixBuff():±K½X°}¦C
Private Function ChangeToShowType(ByRef ChangeBuff() As Byte, _
ByRef MixBuff() As Byte) As String
Dim RetString As String
'´`Àô¥[ªø±K½X°}¦Cªø«×ªº°}¦C
Dim AddBuff() As Byte
Dim I As Long
'³]©w±K½X¥[ªø°}¦C»P³Q¸Ñ±KªºÀÉ®×°}¦Cµ¥ªø
ReDim AddBuff(UBound(ChangeBuff))
'¦pªG³Q¸Ñ±KªºÀÉ®×°}¦C¸û±K½X°}¦Cªø¡A¨º»ò¦¹¬qµ{¦¡¥i¥H±N±K½X°}¦C´`Àô«ÂСC
For I = 0 To UBound(AddBuff)
AddBuff(I) = MixBuff(I Mod (UBound(MixBuff) + 1))
Next
'±N³Q¸Ñ±KªºÀÉ®×°}¦C»P±K½X°}¦Cªº¦U¤¸¯À³v¤@°µ Xor ¹Bºâ¡A
'¥HÁÙì¦sÀɮɪº«½s½X¡C
For I = 0 To UBound(ChangeBuff)
ChangeBuff(I) = ChangeBuff(I) Xor AddBuff(I)
Next
'±N¦r¦ê§ï¦¨ VB ¾A¥Îªº UniCode ®æ¦¡¡C
RetString = StrConv(ChangeBuff, vbUnicode)
ChangeToShowType = RetString
End Function
'¥[±K¦Ûq¨ç¼Æ
'°Ñ¼Æ»¡©ú¡G
'1.ChangeBuff():n³Q¥[±KªºÀÉ®×°}¦C
'2.MixBuff():±K½X°}¦C
Private Sub ChangeToSecretType(ByRef ChangeBuff() As Byte, _
ByRef MixBuff() As Byte, ByVal ChangeString As String)
Dim AddBuff() As Byte
Dim I As Long
''±N¦r¦ê§ï¦¨ Windows ¨t²Îµn°Oªº¦r¦ê®æ¦¡¡C
ChangeBuff = StrConv(ChangeString, vbFromUnicode)
ReDim AddBuff(UBound(ChangeBuff))
For I = 0 To UBound(AddBuff)
AddBuff(I) = MixBuff(I Mod (UBound(MixBuff) + 1))
Next
'±N³Q¥[±KªºÀÉ®×°}¦C»P±K½X°}¦Cªº¦U¤¸¯À³v¤@°µ Xor ¹Bºâ¡A
'¥H§Q¦s¦¨Àɮ׮ɦ³«O¥þªº®ÄªG¡C
For I = 0 To UBound(ChangeBuff)
ChangeBuff(I) = ChangeBuff(I) Xor AddBuff(I)
Next
End Sub
'´ú¸Õ¥»½d¨Ò½Ð©óªí³æ¥¬¸m Command1¡BCommandDialog1
Option Explicit
Private Sub Command1_Click()
'vbPicTypeNone 0 Picture ª«¥óªº¹Ï¥Ü«¬ºA
'vbPicTypeBitmap 1 Picture ª«¥óªºÂI°}¹Ï«¬ºA
'vbPicTypeMetafile 2 Picture ª«¥óªº¤¤Ä~ÀÉ ( Metafile ) «¬ºA
'vbPicTypeIcon 3 Picture ª«¥óªº¹Ï¥Ü«¬ºA
'vbPicTypeEMetaFile 4 Picture ª«¥óªº¥[±j«¬¤¤Ä~ÀÉ ( Enhanced Metafile ) «¬ºA
Dim MyPic As Picture
Dim TypeArray(4) As String
TypeArray(0) = "¹Ï¥Ü«¬ºA"
TypeArray(1) = "ÂI°}¹Ï«¬ºA"
TypeArray(2) = "¤¤Ä~ÀÉ ( Metafile ) «¬ºA"
TypeArray(3) = "¹Ï¥Ü«¬ºA"
TypeArray(4) = "¥[±j«¬¤¤Ä~ÀÉ ( Enhanced Metafile ) «¬ºA"
CommonDialog1.ShowOpen
Set MyPic = LoadPicture(CommonDialog1.filename)
Debug.Print "¹Ï¼e(³æ¦ì Pixel)¡G" & Me.ScaleX(MyPic.Width, vbHimetric, vbPixels)
Debug.Print "¹Ï°ª(³æ¦ì Pixel)¡G" & Me.ScaleY(MyPic.Height, vbHimetric, vbPixels)
Debug.Print "¹ÏÀÉ«¬ºA¡G" & TypeArray(MyPic.Type)
End Sub
MsgBox ¨ç¼Æ¡A¬Ot³d±Ò°Ê¤Î³]©w VB ¤º«Øªº¨t²Î¹ï¸Ü²°¡AÁöµM§Q¥Î»áºÙ«K§Q¡A¦ýÁ`¦³¨Ç¤HÁÙ¬O¶û¥¦¥\¯à¤£°÷¡A©Î¬O¥~Æ[³æ½Õ¤£¦n¬Ý¡A©Ò¥H³\¦h VB ³]p®v³ßÅw¦Û¤v³]p VB ªº¹ï¸Ü¤è¶ô¡C¤£¹L³]p¦Û¤vªº¹ï¸Ü¤è¶ô®É¡A¦³¤@Ó«n¥\¯à¡A´N¬O MsgBox ¨ç¼Æ¥i¥H¨Ì¨Ï¥ÎªÌ¦b¹ï¸Ü®Ø¤¤¤£¦Pªº«ö¶s¡A¦Ó¶Ç¦^¤£¦Pªº¼Æ´Ó¡A¦pªG§Ú̦ۤvªº MsgBox ¨ç¼Æ¨S¦³³o¥\¯à¡A¥¼§K¤Ó¤£¦n¥Î¤F¡C
¦ý MsgBox ³oÓ¨ç¼Æ°Ê§@«o©M¤@¯ë¨ç¼Æ°Ê§@¦³¤@Ó¤Q¤À¤jªº¤£¦P¡A¨º´N¬O´¶³q¨ç¼Æ¥u¦b°õ¦æµ{¦¡³]p®v³]pªºµ{¦¡±Ôz°Ê§@¡A±Ôzµ²§ô±N¼ÆȦ^¶Ç§Y¥i¡A¦ý MsgBox ¨ç¼Æ«o¬On¶}Ó DialogBox ¡AµM«áµ¥¨Ï¥ÎªÌ«öÁä«á¡A¦A¨Ì¨Ï¥ÎªÌ«öÁä¨M©w¨ç¼Æ¦^¶ÇÈ¡A¦pªG§A¥Î¤@¯ëªº¥\¯à¨ç¼Æì²z¥h³]p MsgBox ¡A³Ì«áªºµ²ªG¤@©w¬O¨Ï¥ÎªÌÁÙ¨S«öÁä¡A¨ç¼Æ´N¤w¸g°õ¦æ§¹²¦¡A©Ò¥H¥Ã»·¤]¨S¦³¾÷·|§â¨Ï¥ÎªÌªº¿ï¾Ü¶Ç¦^¨Ó¡A¦Ó¬O¤@ª½¶Ç¦^¨ç¼Æªº¹w³]È¡C
¸Ñ¨M³oÓ°ÝÃDªº¤@Ó²³æ¿ìªk¬O§â¦Û»sªº MsgBox ¨ç¼Æ©ñ¨ì¤½¥Î¼Ò²Õ (Module) ¤¤¥h¡A¨º»ò´N·|²£¥Í¤@ÓÃþ¦ü¨Æ¥ó³qª¾ªº®ÄªG¡A¥i¥Hµ¥«Ý¨Ï¥ÎªÌ¶Ç¦^«öÁäÈ¡C¤U±¬OÓ²³æªº½d¨Ò¡G