vb编程乐园吧
关注: 33 贴子: 329

  • 目录:
  • 个人贴吧
  • 1
    寿星万年历是一款真正意义上万年历,拥有它,你不会再想拥有别的万年历了,这是一款完全开源免费的万年历,但却是JS代码,其作者主要是许剑伟先生,当然还吸取了很多历法高手的研究成果。 我对JS不太了解,所以无法将其转换为VB6,恳请高手忙。我的邮箱是:583669991@QQ.com,谢谢。
    cyfx2288 5-23
  • 1
    我从一个数据库rs1中读取数据去掉前面两个字符替换成服务器名然后保存在第二个数据库rs中出错,提示实时错误5,无效的过程调用或参数,下面一句高亮,高手看看咋解决 If IsNull(rs1(k)) then rs(k)="" Else rs(k) = "\\" & ServerName & Right(rs1(k), Len(Trim(rs1(k))) - 2)‘高亮黄色 End if
  • 0
    我用VB6.0开发的应用程序,在执行某一功能时,出现“运行时错误"429", ActiveX 不能创建对象”的问题,单独添加并注册[url]http://ActiveX控件[/url]问题依旧,用VB6.0安装程序自定义安装,只选择“ActiveX控件”进行安装,问题就能解决,请问这什么原因?谢谢!
    blljcln 11-4
  • 0
    永中Excel的可执行文件是YOZO_CALC.exe,用CreateObject(YOZO_Calc.Application)不能创建,怎么回事?谁知道正确的对象名啊?
    novalight 12-4
  • 0
    请指点一下如何编写将excel的内容导入access的代码
  • 26
    VB6中提供的StrConv这个函数,完全可以解决简繁体的转换问题。下面是一个简繁体的转换的函数,利用该函数区区几行代码,就可以轻松地实现简体到繁体、繁体到简体的相互转化。 '****** 简繁体互换 GB-->BIG5 Or BIG5-->GB ***************** '参数sStr为需要转换的文本 '参数iConver为要转化的类型,为1时表示繁体到简体的转换,为2时表示简体到繁体的转换 Function GBBIG5(sStr As String, iConver As Integer) As String On Error Resume Next Dim STR If iConver = 1 Then
  • 7
    序:不要老是想着谁“最有钱途”,这些都不是我们应当考虑的,我们要考虑的是怎样才能真正的精通VB。如果成为了VB的专家,应当很容易赚到钱的。VB程序员为什么工资低,不是VB不行,是因为大部份VB程序员不行,他们只懂得用控件,而没有什么编程的思想。而VB的初学都只会用控件和简单的API就说精通VB了,显然影响的整个VB在程序界的地位,这些人显然不能称为程序员的,只能相当于会使用VB了,就像会Word一样。如果VB程序员都懂的数据结构,UML
  • 0
    想用vb做一个远程管理的软件,功能比较简单,采用客户机与服务机形式,然后实现自动获取对方进程,然后可以随意结束进程,就这么简单。请高手帮忙~~谢谢啦
  • 0
    毕业设计头大的很,vb编程多路串行,实现温度采集,数据库显示数据,吧主能帮帮忙忙吗?
  • 2
    Private Sub Timer1_Timer() !Dim TMPTOP As Long(这句是什么意思?) !!If LBL3.Top < Me.ScaleHeight Then(这句有什么错误?) LBL3.Top = LBL3.Top + 20 LBL4.Top = LBL4.Top + 20 Else LBL3.Top = -LBLE3.Height LBL4.Top = -LBL4.Height End If If LBL5.Top > -LBL5.Height Then LBL5.Top = LBL5.Top - 20 LBL6.Top = LBL6.Top - 20 Else LBL5.Top = Me.ScaleHeight LBL6.Top = Me.ScaleHeight End If If LBL3.Top = LBL5.Top Then TMPTOP = LBL2.Top LBL1.Top = LBL2.Top LBL2.Top = TMPTOP End If End Sub 跪谢大家了
    9-3
  • 0
    Option Base 1 Private Sub Command1_Click() Dim a a = Array(1, 1, 1, 1) Call sub1(a, 4) For i = 1 To 4 Print a(i) Next i End Sub Public Sub sub1(x, n) If n > 1 Then For i = 1 To n x(n) = x(n) + 1 Call sub1(x, n - 1) Next i End If End Sub
    7-19
  • 8
    例为设置密码窗口 (1) If Application.InputBox("请输入密码:") = 1234 Then [A1] = 1 '密码正确时执行 Else: MsgBox "密码错误,即将退出!" '此行与第2行共同设置密码 End If 本示例为设置密码窗口 (1) X = MsgBox("是否真的要结帐?", vbYesNo) If X = vbYes Then Close 本示例为设置工作表密码 ActiveSheet.Protect Password:=641112 ' 保护工作表并设置密码 ActiveSheet.Unprotect Password:=641112 '撤消工作表保护并取消密码 '本示例关闭除正在运行本示例的工作簿以外的其他所有
    gslzx2000 5-12
  • 3
    编写VB程序时,经常遇到的问题就是VB给我们准备的东西我们会用,控件组装就是一个程序,然而一旦想要实现VB没有直接提供的功能,就会不知所措。其实Windows操作系统本身就给我们准备了许多东西,VB没有的,或许Windows有。我们当然希望少花力气,多得效果。这里要讲的内容就是——学会利用Windows给我们的东西:API。   然而,学会一种东西是需要付出相当的努力的,API也一样,它可以给我们带来很大的方便,但想要掌握它,就不是使用几个控
    805548138 4-8
  • 0
    请问,能不能将窗体设置为透明、而其上的控件不透明呢?
    江淮农夫 12-31
  • 1
    Private Declare Fun(百度傻)ction GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer '检查键值 Private Fun(百度傻)ction KeyIsDown(vKeyCode) As Boolean KeyIsDown = (GetAsyncKeyState(vKeyCode) < 0) End Fun(百度傻)ction Private Sub EditCut_Click() Clipboard.Clear Clipboard.SetText Screen.ActiveControl.SelText Screen.ActiveControl.SelText = "" End Sub Private Sub EditCopy_Click() Clipboard.Clear Clipboard.SetText Screen.ActiveControl.SelText End Sub Private Sub EditDelete_Click() Screen.ActiveControl.SelText = "" End Sub Private
    4-17
  • 8
    一、 控件与消息函数 AdjustWindowRect 给定一种窗口样式,计算获得目标客户区矩形所需的窗口大小 AnyPopup 判断屏幕上是否存在任何弹出式窗口 ArrangeIconicWindows 排列一个父窗口的最小化子窗口 AttachThreadInput 连接线程输入函数 BeginDeferWindowPos 启动构建一系列新窗口位置的过程 BringWindowToTop 将指定的窗口带至窗口列表顶部 CascadeWindows 以层叠方式排列窗口 ChildWindowFromPoint 返回父窗口中包含了指定点的第一个子窗口的句柄 ClientToScreen 判断窗口内
    3-10
  • 1
    Private Declare Fun(百度傻)ction FindWindowEx Lib "user32" Alias _ "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As _ Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Private Declare Fun(百度傻)ction ShowWindow Lib "user32" (ByVal _ hwnd As Long, ByVal nCmdShow As Long) As Long Private Declare Fun(百度傻)ction FindWindow Lib "user32" Alias _ "FindWindowA" (ByVal lpClassName As String, ByVal _ lpWindowName As String) As Long Const SW_HIDE = 0 Const SW_SHOW = 5 Dim bx As Boolean Private Sub Form_Click() Dim hLong As Long Dim hwnd As L
    storm0909 1-25
  • 2
    Dim Snow(1000, 2), Amounty As Integer Private Sub Form_Load() Form1.Show DoEvents Randomize: Amounty = 325 For J = 1 To Amounty Snow(J, 0) = Int(Rnd * Form1.Width) Snow(J, 1) = Int(Rnd * Form1.Height) Snow(J, 2) = 10 + (Rnd * 20) Next J Do While Not (DoEvents = 0) For LS = 1 To 10 For I = 1 To Amounty OldX = Snow(I, 0): OldY = Snow(I, 1): Snow(I, 1) = Snow(I, 1) + Snow(I, 2) If Snow(I, 1) > Form1.Height Then Snow(I, 1) = 0: Snow(I, 2) = 5 + (Rnd * 30): Snow(I, 0) = Int(Rnd * Form1.Width): OldX = 0: OldY = 0 Coloury = 8 * (Snow(I, 2) - 10): Coloury = 60 + Coloury: PSet (Ol
    superwg 12-31
  • 0
    Sub 主表() ' ' 主表 Macro ' '      ActiveSheet.Unprotect ("172212473")      ActiveSheet.Range("$A$3:$AH$500").AutoFilter Field:=1, Criteria1:="<>"      ActiveSheet.ShowAllData     ActiveSheet.Protect ("172212473") End Sub 这下面是保护工作表时的选项代码,只钩选允许自动筛选时的,      ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _      &nbsp
    cococ_p100 7-20
  • 0
    2009-06
    大家帮帮忙阿 我现在急需一个数据库 用VB编写的 请老大门帮忙啊
    6-29
  • 0
    我买的书籍是图片加代码的,我不太了解他的具体的一些理论,连整形16和整形32都不知道是什么意思,
    6-24
  • 1
    Private Sub Form_Load() Dim RemainDay As Long RemainDay = GetSetting("MyApp", "set", "times", 0) If RemainDay = 10 Then MsgBox "试用次数已满,请……" Unload Me End If MsgBox "现在剩下:" & 10 - RemainDay & "试用次数,好好珍惜!" RemainDay = RemainDay + 1 SaveSetting "MyApp", "set", "times", RemainDay End Sub
  • 1
    Option Explicit Const MAX_TOOLTIP As Integer = 64 Const NIF_ICON = &H2 Const NIF_MESSAGE = &H1 Const NIF_TIP = &H4 Const NIM_ADD = &H0 Const NIM_DELETE = &H2 Const WM_MOUSEMOVE = &H200 Const WM_LBUTTONDOWN = &H201 Const WM_LBUTTONUP = &H202 Const WM_LBUTTONDBLCLK = &H203 Const WM_RBUTTONDOWN = &H204 Const WM_RBUTTONUP = &H205 Const WM_RBUTTONDBLCLK = &H206 Const SW_RESTORE = 9 Const SW_HIDE = 0 Private Type NOTIFYICONDATA cbSize As Long hwnd As Long uID As Long uFlags As Long uCallbackMessage As Long hIcon As Long szTip As String * MAX_TOOLTIP End Type Private
  • 1
    '添加 Command1 Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long Const MF_BYPOSITION = &H400& Const MF_REMOVE = &H1000& Sub Form_Loa
  • 3
    下面的代码演示将一个程序在执行时将自己删除。 新建一个窗体,并加一上按钮,添如下代码 Private Sub Command1_Click() KillMe End Sub Sub KillMe() Path = App.Path If Right(Path, 1) <> "\" Then Path = Path + "\" PathName = Path + App.EXEName + ".EXE" BatName = Path + "1.bat" Open BatName For Output As #1 Print #1, ":START" Print #1, "del " & PathName Print #1, "if exist " & PathName & " GOTO START" Print #1, "del " & BatName Close #1 Shell BatName, vbHide End End Sub
    4-29
  • 5
    第一件事当然是新建一个工程,然后引入所需控件。在“红绿灯”程序中,我们需要用到的控件有:OptionButton(选项按钮)、Image(图像框)及Timer(时钟)控件。引入两个OptionButton,其中Option1的Caption设置为“红灯”,Option2的Caption设置为“绿灯”;Image1的Picture属性设置为红灯图片,选择一张红灯图片(读者可以自己创建一个红灯及绿灯图片)。设计好的程序界面如图1。   好了,现在我们开始添加程序代码。   我们要求程序能够通过我们所
    2-28
  • 0
    Option Explicit Private Declare Fun百度傻ction LockWorkStation Lib "user32.dll" () As Long Private Sub Command1_Click() LockWorkStation End Sub
    刘福兴 12-1
  • 2
    参考下列程序: Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0 End If End Sub
  • 1
    '模块代码 Option Explicit Private Declare Fun(百度傻)ction SetTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long Private Declare Fun(百度傻)ction KillTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long Private Declare Fun(百度傻)ction GetCurrentThreadId Lib "kernel32" () As Long Private Declare Fun(百度傻)ction UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long Private Declare Fun(百度傻)ction SetWindowsHookEx Lib "user32" Alias "Se
    刘福兴 11-26
  • 1
    常数 值 描述 vbKeyLButton 0x1 鼠标左键 vbKeyRButton 0x2 鼠标右键 vbKeyCancel 0x3 CANCEL 键 vbKeyMButton 0x4 鼠标中键 vbKeyBack 0x8 BACKSPACE 键 vbKeyTab 0x9 TAB 键 vbKeyClear 0xC CLEAR 键 vbKeyReturn 0xD ENTER 键 vbKeyShift 0x10 SHIFT 键 vbKeyControl 0x11 CTRL 键 vbKeyMenu 0x12 MENU 键 vbKeyPause 0x13 PAUSE 键 vbKeyCapital 0x14 CAPS LOCK 键 vbKeyEscape 0x1B ESC 键 vbKeySpace 0x20 SPACEBAR 键 vbKeyPageUp 0x21 PAGE UP 键 vbKeyPageDown 0x22 PAGE DOWN 键 vbKeyEnd 0x23 END 键 vbKeyHome 0x24 HOME 键 vbKeyLeft 0x25 LEFT ARROW
    刘福兴 11-24
  • 0
    我写了一个模块。下面是模块的代码: Option Explicit Public Sub SetAutoRun() Dim R As Object, Mypath As String Mypath = App.Path If Right(App.Path, 1) <> "\" Then Mypath = Mypath & "\" Set R = CreateObject("wscript.shell") R.regwrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\" & App.EXEName, Mypath & App.EXEName & ".exe" End Sub '请把百度限制词全部去掉,因为百度不能发 [函数] 这个英文单词。 Public Fun百度限制词ction UnAutorun() On Error Resume Next Dim R As Object Set R = CreateObject("wscript.shell"
    刘福兴 11-22
  • 0
    最近在看手机用的MMS文件(手机彩信的格式)的数据结构 觉得这种节省整型数存储空间的方法很好 一个整型数据一般要4个字节,但是有时候存储空间很紧张,但是数字的取值范围却很大 比如一个数的取值范围从0 - 2^64 都有可能,但是有不能用8个字节来存放,太浪费。 手机上是这样解决的 用一系列连续的字节来表示整数,字节的最高位作为标志位,高位为1表示后面还有一个字节 高位为0表示这是最后一个字节,其余的7位表示整数的值,
    刘福兴 11-21
  • 0
    Option Explicit Private Declare Fun(百度傻)ction SendMessage Lib "user32" _ Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg _ As Long, ByVal wParam As Long, ByVal lParam As Long) _ As Long Const WM_SYSCOMMAND = &H112& Const SC_MONITORPOWER = &HF170& Private Sub Form_Load() SendMessage Me.hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, 2&'根据MSDN,这个参数如果是1,则 表示显示器处于低能耗状态。 End Sub
    刘福兴 11-21
  • 0
    Option Explicit Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long) Public Declare Fun(百度傻)ction GetIpAddrTable Lib "IPHlpApi" (pIPAdrTable As Byte, pdwSize As Long, ByVal Sort As Long) As Long Const Max_IP = 5 Type IPINFO dwAddr As Long dwIndex As Long dwMask As Long dwBCastAddr As Long dwReasmSize As Long UnUsed1 As Integer UnUsed2 As Integer End Type Type MIB_IPADDRTABLE dEntrys As Long mIPInfo(Max_IP) As IPINFO End Type Type IP_Array mBuffer
    刘福兴 11-21
  • 0
    方法一: 弄个按钮,在按钮的click事件中 Dim x x= Shell("rundll32.exe rnaui.dll,RnaDial " & "连接_名称", 1)'这是打开你的连接 X=rundll32.exe shell32.dll,Control_RunDLL netcpl.cpl '这是打开网络连接 方法二: Shell "Rasdial 宽带连接 帐号ID 帐号密码", vbNormalFocus 自动拨号,建立连接
    刘福兴 11-21
  • 0
    '移动无规则窗口,并设有保持窗口不移出屏幕的功能 Private Declare Fun(百度傻)ction ReleaseCapture Lib "user32" () As Long Private Declare Fun(百度傻)ction SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Sub MoveWindow(Frm As Form) On Error GoTo ccc ReleaseCapture SendMessage Frm.hwnd, &HA1, 2, 0 If Frm.Top <= 500 Or Frm.Top < 0 Then Frm.Top = 0 If Frm.Top >= Screen.Height - Frm.Height Or Frm.Top >= Screen.Height - Frm.Height - 500 Then Frm.Top = Screen.He
    刘福兴 11-20
  • 0
    Option Explicit Private Declare Fun(百度傻)ction SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Private Const WM_SYSCOMMAND = &H112 Private Const SC_MAXIMIZE = &HF030& Private Const SC_MINIMIZE = &HF020& Private Const SC_RESTORE = &HF120& Private Sub Command1_Click() SendMessage Me.hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0 End Sub Private Sub Command2_Click() SendMessage Me.hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0 End Sub Private Sub Command3_Click() SendMessage hwnd, WM_SYSCOMMAND, SC_
    刘福兴 11-20
  • 0
    Private Sub Text1_Click() Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text) Text1.SetFocus End Sub
    刘福兴 11-20
  • 0
    Option Explicit Private Declare Fun(百度傻)ction TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As L
    刘福兴 11-20
  • 0
    Private Sub Command1_Click() Label1.Caption = Text1.Text Timer1.Enabled = True End Sub Private Sub Text1_Change() Label1.Caption = Te
    刘福兴 11-19
  • 0
    Option Explicit Private DBName$, oldPath$ 'Browse database file. Private Sub cmdBrowse_Click() lblPassWord.Caption = "" oldPat
    刘福兴 11-19
  • 0
    Option Explicit Dim CurY As Single Private Sub Command1_Click() CurY = Picture1.Height Timer1.Enabled = True End Sub Private
    刘福兴 11-19
  • 0
    '窗体代码 Option Explicit Private Sub Form_Load() '第一种方法 Dim hwndMenu As Long Dim c As Long hwndMenu = GetSystemMenu(Me.hwnd
    刘福兴 11-19
  • 0
    '窗体代码 Option Explicit Private Sub Cancel_Click() Unload Me 'exit the program End Sub Private Sub Control_Click() Call
    刘福兴 11-19

  • 发贴红色标题
  • 显示红名
  • 签到六倍经验

赠送补签卡1张,获得[经验书购买权]

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!

本吧信息 查看详情>>

会员: 会员

目录: 个人贴吧

友情贴吧