博文
将1,2,3,4组合成互不相同且不重复的三位数(2005-10-23 21:11:00)
摘要:Private Sub Command1_Click()b = "1234"s = 1For i = 1 To 4 a1 = Mid(b, i, 1) b1 = Replace(b, a1, "") For j = 1 To 3 a2 = Mid(b1, j, 1) b2 = Replace(b1, a2, "") For k = 1 To 2 a3 = Mid(b2, k, 1) Print s, a1 & a2 & a3 s = s + 1 Next NextNextEnd Sub......
更改无标题窗体的大小(2005-10-23 01:35:00)
摘要:'添加一个Label控件,作为右下角的标记'Tcmcz制作
Private Sub Form_Load() With Label1 .Caption = "" .BackColor = RGB(0, 0, 255) '如觉得右下角这个点不好看,可改为:.BackStyle = 0 .Height = 100 .Width = 100 .Left = Me.ScaleWidth - 100 .Top = Me.ScaleHeight - 100 .MousePointer = 8 End WithEnd Sub
Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Static OldX, OldY As Single OldX = X: OldY = YEnd Sub
Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) PianyiX = X - OldX: PianyiY = Y - OldY Label1.Left = Label1.Left + PianyiX Label1.T......
用按钮调整列表框项目的顺序(2005-10-10 00:02:00)
摘要:Private Sub Command1_Click()With List1 temp = .List(.ListIndex) .List(.ListIndex) = .List(.ListIndex - 1) .List(.ListIndex - 1) = temp .ListIndex = .ListIndex - 1End WithLabel1.Caption = List1.TextEnd Sub
Private Sub Command2_Click()With List1 temp = .List(.ListIndex) .List(.ListIndex) = .List(.ListIndex + 1) .List(.ListIndex + 1) = temp .ListIndex = .ListIndex + 1End WithLabel1.Caption = List1.TextEnd Sub
Private Sub Form_Load()For i = 0 To 10 List1.AddItem iNextList1.ListIndex = 1End Sub......
