¡@¼ÊºÙ: ÀH·ÄÆ¿ºªº¦Ð¤ò ¡@ÀY»Î: [±s¥Î]¼ç¤ô¸¥
°ª¤¤¥Í
- ©«¤l
- 852
- ¥DÃD
- 79
- ºëµØ
- 0
- ¿n¤À
- 918
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7 , XP
- ³nÅ骩¥»
- Office 2007, Office 2003,Office 2010,YoZo Office
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¦t©z
- µù¥U®É¶¡
- 2011-4-8
- ³Ì«áµn¿ý
- 2024-2-21
|
[ì³Ð] Visual Base 2010 °}¦Cµ²ªG Part 2
µ{¦¡»¡©ú
»¡©ú1.¦¹¬°¤j½d³ò°}¦C°Ï°ì©MCombobox ¹ïÀ³Ãö«Y¡A¦ý¥²¶·¥ý·s¼W Combobox ©M Label ¦U¤@Ó¡C
»¡©ú2.³oÓµ{¦¡¥iÀ³¥Î©óÀɮ׬[ºÞ²z¡B¾÷©Ð°t¸mªí¡C
»¡©ú3.Y¦³°ÝÃD¥i¥H¸ß°Ý¡A¦ý¤£¥Nªí§Ú¥þ·|~
°õ¦æµ²ªG¹Ï¤ù
µ{¦¡½X°Ï°ì- Public Class Form1
- Dim bubo1(25, 4) As Button
- Dim chcom As ComboBox
- Dim labcom As Label
- Private Sub Form1_Invalidated(ByVal sender As Object, ByVal e As System.Windows.Forms.InvalidateEventArgs) Handles Me.Invalidated
- With Me
- .Height = 900
- .Width = 1650
- End With
- End Sub
- Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
- Dim usx1, usy1 As Integer
- Dim nn As Integer
- chcom = Me.ComboBox1
- Dim fontFamily As New FontFamily("·L³n¥¿¶ÂÅé")
- Me.Show()
- nn = 1
- For usx1 = 0 To 25
- For usy1 = 0 To 4
- bubo1(usx1, usy1) = New button
- Me.Controls.Add(bubo1(usx1, usy1))
- bubo1(usx1, usy1).BackColor = Color.Aquamarine
- bubo1(usx1, usy1).Width = 37
- bubo1(usx1, usy1).Height = 150
- bubo1(usx1, usy1).AutoSize = False
- bubo1(usx1, usy1).TextAlign = ContentAlignment.MiddleCenter ' ¤W¤U¥ª¥k¸m¤¤
- bubo1(usx1, usy1).Font = New Font(fontFamily, 12, FontStyle.Regular, GraphicsUnit.Pixel) ' ¦rÅé¡B¤j¤p¡BÃþ«¬
- bubo1(usx1, usy1).Location = New Point(10 + (43 * usx1), 10 + (155 * usy1))
- 'bubo1(usx1, usy1).Appearance = Appearance.Button '«ö¶s«¬ºA
- bubo1(usx1, usy1).Text = bubo1(usx1, usy1).Name & "²Ä O °Ï°ì" & Chr(10) & "²Ä" & " " & nn & " " & "°Ï¶ô"
- '¤À¹j½u'
- chcom.Items.Add(bubo1(usx1, usy1).Text)
- nn = nn + 1
- Next
- Next
- usx1 = Nothing
- usy1 = Nothing
- End Sub
- Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
- labcom = Me.Label1
- 'labcom.Text = Me.chcom.Text
- If Me.chcom.Text <> "" Then
- 'MsgBox(Me.chcom.Text) '& Chr(10) & Me.bubo1(25, 4).Text)
- If (InStr(Me.chcom.Text, "¶ô") >= 1) Then
- 'MsgBox(Me.chcom.Text & Chr(10) & "¦b²Ä" & InStr(Me.chcom.Text, "¶ô") & "¦ì") '& Chr(10) & Mid(Me.chcom.Text, 10, 1))
- End If
- For aaa = 1 To 2
- For usx1 = 0 To 25
- For usy1 = 0 To 4
- If bubo1(usx1, usy1).Text = Me.chcom.Text Then
- labcom.Text = bubo1(usx1, usy1).Text
- bubo1(usx1, usy1).BackColor = Color.DarkSalmon
- ElseIf bubo1(usx1, usy1).Text <> Me.chcom.Text Then
- bubo1(usx1, usy1).BackColor = Color.Aquamarine
- End If
- Next
- Next
- Next
- End If
- End Sub
- End Class
½Æ»s¥N½X |
|