- 博客(25)
- 资源 (1)
- 问答 (1)
- 收藏
- 关注
原创 VB程序学习代码记录20160731
常用的文件操作函数Private Sub Form_Click() Dim mypath mypath = CurDir Print mypath mypath = CurDir("C") Print mypath Dim strtime strtime = FileDateTime("D:\百川教育") Print strtime
2016-07-31 13:02:37 323
原创 VB程序学习代码记录20160730
改变当前盘符Private Sub Command1_Click() ChDrive Drive1.List(Drive1.ListIndex) Unload Me Load Form2 Form2.Show Drive1.RefreshEnd Sub
2016-07-30 15:59:57 317
原创 VB程序学习代码记录20160729
驱动器列表框(DriveListBox控件)Private Sub Command1_Click() Dim i As Integer Dim s As String For i = 0 To Drive1.ListCount - 1 s = s & vbCrLf & Drive1.List(i) Label2.Caption = s
2016-07-29 16:04:04 340
原创 VB程序学习代码记录20160726
多级树状视图Dim cnn As New ADODB.ConnectionDim rs1 As New ADODB.RecordsetDim i As Integer, bmjc As IntegerDim blntj As BooleanDim bmbh As StringPrivate Sub Form_Load() Me.Caption = "部门管理" cnn.Ope
2016-07-26 23:46:48 372
原创 VB程序学习代码记录20160725
树状控件示例Private Sub Form_Load() Dim nodex As Node Dim i As Integer TreeView1.Style = tvwTreelinesPlusMinusPictureText TreeView1.BorderStyle = ccFixedSingle Dim a a = Array("(01)工程
2016-07-25 17:09:03 295
原创 VB程序学习代码记录20160724
为工具栏添加事件代码Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Key Case "add" Case "modify" Case "delete" Case "save" Case
2016-07-24 11:05:25 535
原创 VB程序学习代码记录20160723(2)
菜单改变背景色Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 2 Then PopupMenu MyMenu End IfEnd SubPrivate Sub red_click() Form1.BackC
2016-07-23 23:30:53 433
原创 VB程序学习代码记录20160723
文本实例Private Sub Command1_Click() For i = 0 To 2 If Option1(i).Value = True Then Text1.FontName = Option1(i).Caption End If Next i If Option4(0).Value = True Then
2016-07-23 09:58:34 527
原创 VB程序学习代码记录20160722(2)
用户登录**form1:**Private Sub Command1_Click() If Text1.Text <> "" Then If Text2.Text = "" Then MsgBox "请输入密码!" Exit Sub Else Form2.Show
2016-07-22 22:49:50 388
原创 VB程序学习代码记录20160722
使用API函数enablewindow,禁止所有鼠标和键盘相关操作。Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As LongPrivate Sub Form_Load() EnableWindow Command1.hwnd, 0End Sub
2016-07-22 14:32:58 502
转载 Copy、CopyFile、FileCopy的用法
API函数copyfile。1、Copy 方法 描述 把一个指定的文件或文件夹从一个地方复制到另一个地方。 语法 object.Copy destination[, overwrite] Copy 方法语法有如下几部分: 部分 描述 object 必需的。始终是一个 File 或 Folder 对象的名字。 destination 必需
2016-07-21 23:00:55 30447
原创 VB程序学习代码记录20160721
清理字符串Private Sub Command1_Click() Dim i As Integer Dim tex As String If Text1.Text = "" Then MsgBox "请输入字符串", vbInformation, "信息提示" Else tex = Trim(Text1.Text) i
2016-07-21 19:51:30 303
原创 VB程序学习代码记录20160719
IsNull函数Private Sub Form_Click() Dim num Print IsNull(num) num = "" Print IsNull(num) num = "abcd" Print IsNull(num) num = Null Print IsNull(num)End Sub
2016-07-19 18:19:07 291
原创 VB程序学习代码记录20160718(2)
abs函数private sub form_click() print abs(50.3) print abs(-50.3)end subexp函数Private Sub Form_Click() Dim myangle, myhsin myangle = 1.3 myhsin = (Exp(myangle) - Exp(-1 * myangle)) / 2
2016-07-18 20:37:25 369
原创 VB程序学习代码记录20160718
计算面积 子过程Private Sub Command1_Click() area Text1.Text, Text2.TextEnd SubPrivate Sub area(length, width) Label1.Caption = length * widthEnd Sub
2016-07-18 14:31:50 756
原创 VB程序学习代码记录20160717
数组元素插入Dim a() As LongPrivate Sub Form_Load() ReDim Preserve a(1 To 4) a(1) = 1: a(2) = 2: a(3) = 3: a(4) = 4 Dim i As Long, m As Long Debug.Print vbNewLine & "原数组元素:" For i = 1 To 4
2016-07-17 16:04:54 287
转载 简单排序算法
由于程序比较简单,所以没有加什么注释。所有的程序都给出了完整的运行代码,并在我的VC环境 下运行通过。因为没有涉及MFC和WINDOWS的内容,所以在BORLAND C++的平台上应该也不会有什么 问题的。在代码的后面给出了运行过程示意,希望对理解有帮助。1.冒泡法: 这是最原始,也是众所周知的最慢的算法了。他的名字的由来因为它的工作看来象是冒泡:#include <iostream.h>vo
2016-07-15 14:44:36 155
原创 VB程序学习代码记录20160715
选择排序法Dim a(9) As LongPrivate Sub Command1_Click() Dim i As Long, l As Long, n As Long For i = 0 To 9 For l = i To 9 If a(i) > a(l) Then n = a(i)
2016-07-15 14:18:42 304
原创 VB程序学习代码记录20160714
VB常用的数据类型有:整型(Integer,表示-32768至32767之间的整数)长整型(Long,表示-2,147,483,648至2,147,483,647之间的整数)实型(Single,表示-3.37E+38至3.37E+38之间的实数)双精度实型(Double,表示-1.67E+308至1.67E+308之间的实数)字符(String,每个字符占一字节,可以储存0~65,535个
2016-07-14 15:59:16 559
原创 VB程序学习代码记录20160713
选择月份Private Sub Form_Load() Dim i% For i = 1 To 12 List1.AddItem i & "月" Next iEnd Sub
2016-07-13 22:11:12 252
原创 VB程序学习代码记录20160711
列表交换Private Sub List1_DblClick()List2.AddItem List1.TextList1.RemoveItem List1.ListIndexEnd SubPrivate Sub List2_Click()List1.AddItem List2.TextList2.RemoveItem List2.ListIndexEnd Sub
2016-07-11 08:21:05 292
原创 VB程序代码学习记录20160710
Private Sub C1_Click()If Shape1.Visible = True Then Shape1.Visible = False Shape2.Visible = TrueElseIf Shape2.Visible = True Then Shape2.Visible = False Shape3.Visible = TrueElse
2016-07-10 18:17:11 241
原创 VB程序代码学习记录20160709
Private Sub Form_Click() Print Font.Size = 14 Font.Name = "华文行楷" Print Tab(45); Year(Date) & "年" & Month(Date) & "月份图书销售排行" CurrentY = 700 Font.Size = 9 Font.Name = "宋体"
2016-07-09 10:18:57 354
原创 [Python] 利用Python做汉诺塔问题递归
首先初始化这个问题: 设三根柱子分别为A、B和C,圆环个数为n且位于A,目标柱子是C。然后抽象地看待这个问题: 从下往上看问题:假设把底盘n移动到C后,由于底盘n将不会再有任何移动,这时实际上就可以无视n了。于是第n-1个(初始状态的倒数第二个)环成为新的底盘,将n-1移动到C后,同样可以无视之。以此类推,不停地无视底盘、简化圆环个数:n-2,n-3……剩5个圆环、4个、3个……最后其实就剩下2
2016-07-06 10:39:18 508
原创 [Python] 使用python的随机验证码。
from PIL import Image, ImageDraw,ImageFont, ImageFilterimport random# 随机字母(含大小写)def rndChar(): return chr(random.randint(65,122)) # 随机数字def rndInt(): return chr(random.randint(48,57))# 随机颜色1
2016-07-06 10:37:51 436
python学习路线推荐?
2016-06-16
TA创建的收藏夹 TA关注的收藏夹
TA关注的人