想设计一个简单的vb程序,高手帮忙
老大,你的问题就有问题,四个孤零零的标,没有任何联系,这几乎什么功能都实现不了,至少在仓库的表里有一项职工编号,在零件表里有仓库号、供应商编号,这样四个表才能关联起来
这个东西虽然不难,但是有点麻烦,只有拿2分走人
Private Sub Form_Load()
Command1.Caption = "显示"
End Sub
Private Sub Command1_Click()
Command1.Caption = "显示"
If Command1.Caption = "显示" Then
Text1.FontSize = 20
Text1.Text = "这是我的第一个VB应用程序"
Else
Command1.Caption = "继续"
Text1.FontSize = 26
Text1.Text = "敬请赐教,谢谢!"
End If
End Sub
循环语句自己写
希望能追加一些分数·毕竟手动
运用到 转换小写 和一些简单的东西
2个list 3个按钮 2个文本框
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2895
ClientLeft = 60
ClientTop = 450
ClientWidth = 4515
LinkTopic = "Form1"
ScaleHeight = 2895
ScaleWidth = 4515
StartUpPosition = 3 '窗口缺省
Begin VB.ListBox List1
Height = 1500
ItemData = "Form1.frx":0000
Left = 600
List = "Form1.frx":0002
TabIndex = 8
Top = 1200
Width = 2415
End
Begin VB.CommandButton Command3
Caption = "删除"
Height = 495
Left = 3120
TabIndex = 7
Top = 1680
Width = 855
End
Begin VB.CommandButton Command2
Caption = "读取"
Height = 495
Left = 3480
TabIndex = 6
Top = 720
Width = 855
End
Begin VB.ListBox List2
Height = 1500
ItemData = "Form1.frx":0004
Left = 600
List = "Form1.frx":0006
TabIndex = 5
Top = 3000
Width = 2415
End
Begin VB.CommandButton Command1
Caption = "存入"
Height = 495
Left = 3480
TabIndex = 4
Top = 120
Width = 855
End
Begin VB.TextBox Text2
Height = 270
Left = 720
TabIndex = 1
Text = "钱"
Top = 720
Width = 2535
End
Begin VB.TextBox Text1
Height = 270
Left = 720
TabIndex = 0
Text = "Money"
Top = 240
Width = 2535
End
Begin VB.Label Label2
Caption = "解释"
Height = 255
Left = 120
TabIndex = 3
Top = 720
Width = 495
End
Begin VB.Label Label1
Caption = "英文"
Height = 255
Left = 120
TabIndex = 2
Top = 240
Width = 495
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Shu As String
Private Sub Command1_Click()
Dim Nei As String
Nei = Text1.Text & "----" & Text2.Text
List1.AddItem Text1.Text & "----" & Text2.Text
List2.AddItem Text2.Text
Open "c:\1.txt" For Append As #1
Print #1, Nei
Close #1
End Sub
Private Sub Command2_Click()
Dim s, cc As String
Dim str() As String
Dim i As Integer
If Dir("c:\1.txt") = "" Then
MsgBox "请先存入"
Else
List1.Clear
List2.Clear
List3.Clear
Open "c:\1.txt" For Input As #1
Do Until EOF(1)
Line Input #1, s
str = Split(s, "----")
List2.AddItem LCase((str(0)))
List1.AddItem (str(1))
Loop
Close #1
End If
End Sub
Private Sub Command3_Click()
List2.RemoveItem (List1.ListIndex)
List1.RemoveItem (List1.ListIndex)
End Sub
Private Sub Form_Load()
End Sub
Private Sub List1_Dblclick()
Dim Nuu As String
Nuu = InputBox("请输入英文", "英文")
Nuu = LCase(Nuu)
List2.Selected(List1.ListIndex) = True
If Nuu = List2.Text Then
MsgBox "对了", 64, "(*^__^*)...嘻嘻"
Else
MsgBox "错了", 48, "郁闷"
End If
End Sub
要带出来倒是简单,但是你要在数据库里面输入资料,否则的话就带不出来。
用VB设计一个程序,将输入的字符串以反序显示
Private Sub Command1_Click()Dim S As String, T As String S = InputBox("输入一个字符串")Print T Dim I As Integer For I = Len(S) To 1 Step -1 T = T & Mid(S, I, 1)Next Print T End Sub最简单的Private Sub Command1_Click()Dim S As String, T As String S = ...
利用VB制作一个“随机生成十个数字(1-100之间的整数)求极值(最大最小...
tempEnd IfNext jNext imax = num(1)min = num(10)avg = sum * 1# \/ 10End SubPrivate Sub Command2_Click()If Text1.Text = "" ThenMsgBox "没有数组,无法计算!"ElseLabel4.Caption = maxLabel5.Caption = minLabel6.Caption = avgEnd IfEnd Sub设计好的窗体:程序运行的窗体:...
VB编写程序:设计一个程序,当单击窗体时,在窗体上显示任意一幅图片。怎样...
首先添加一个窗体,在这个窗体上加一个文本框的控件,在这个文本框的单击事件中写如下的程序:Dim num, sum, it(1), n, t, hPrivate Sub Form_Click()File1.Refreshsum = 0List1.ClearFor i = 0 To File1.ListCount - 1t = Split(File1.List(i), ".")(UBound(Split(File1.List(i...
我设计了一个很简单的VB程序,但是总是显“方程的值为False或False”这是...
If d >= 0 Then Print "方程的值为"; x1 = (-b + Sqr(d)) \/ (2 * a); "或"; x2 = (-b - Sqr(d)) \/ (2 * a), Else Print "方程无解"这一段错了,你还可以考虑考虑。嘿嘿。
用VB6.0设计简单程序
VB6.0测试通过 '利用随机函数产生60个100~200之间的随机整数,将其中的偶数按由小到大的顺序排列并输出,将奇数按由大到小的顺序排列并输出。'1.将随机产生的60个整数按每行10个数输出到窗体或文本框中。'2.将排好序的偶数和奇数分别输出到两个文本框中。Dim RndArray(6, 10) As Integer Di...
写一个简单的VB程序(送高积分,谈钱免了)。
我擦,这么简单的问题怎么会有那么多要求啊,还参考文献?只要学过VB都该会吧,参考什么文献?(教科书?)1:略过 (一个text1,一个command控件)2:(1):dim i as integer '变量说明 控件:text1.multiline=ture text1.scrollbars=2 (2):核心算法就是:对每一个text1中的字符进行判断ascii...
vb程序设计
代码如下 1.sum=1 for i=1 to 10 sum=sum*i next i print sum 2.for i=1 to 5 sum=1 for j=1 to i sum=sum*i next j s=s+sum next i print s 3.for i= 1 to 100 j=j-1\/i*(-1)^i next i 4.a=inputbox("输入一自然数:")if a>0 then msgbox "正数"if a>0...
如何用VB设计一个简单的应用程序来实现“单击按钮打开运行计算机中的...
As String, ByVal nShowCmd As Long) As Long '再窗体画个按钮 private sub command1_click()ShellExecute me.hwnd,"open","文件路径","运行参数","",显示方式 end sub '其中文件路径为你要打开的文件,当然不只exe文件,如果是exe文件则可以带参数,显示方式有很多种,为1时表示正常显示 ...
毕业设计要用vb作一个程序 本人vb新手 希望有vb大侠能帮帮忙 指导我一...
用VB制作一个简单记事本问题! 比如我定义如下控件: text文件控件名字:a_txt 对话框控件名字:cmd_dlg 一个按扭名字:cmd_open 我想实现这样的一个功能,单击cmd_open就弹出一个对话框,然后选择一个文本文件(*.txt)。打开,就会在a_txt这个控件上边显示文本文件内容,应该怎么样做呢?我不太懂VB,请各位朋友帮我完成...
有谁可以帮我设计一个vb程序,简单点的就可以!但是不要太简单,要有步骤...
Dim r&, r1&, t&, a1!, a2!, xb!, yb!, s!, b Private Sub Form_Load()'Me.Width = 5500: Me.Height = 5500 Me.Move (Screen.Width - Me.Width), (Screen.Height - Me.Height)Me.AutoRedraw = True Me.Caption = "万花筒"Set Timer1 = Controls.Add("vb.timer", "Timer1...
僪炒复方: 锁键盘 先建一个模块 代码如下: Public hHook As Long Public h_Hook As Long Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long Declare Function SetWindowsHookEx Lib "user32" Alias "...
东昌府区15747516286: 帮忙制作一个简单的VB程序 很简单的! - ?
僪炒复方: Private Sub Command1_Click() i = 0 s = 0 While i < 11 s = s + i i = i + 2 Wend Print s End Sub
东昌府区15747516286: 高分~!在线等~!帮忙编一个简单的vb程序~! - ?
僪炒复方: Private Sub Command1_Click()Dim nStr As String, S As Long, a As Single, b As Single, c As SinglenStr = InputBox("请输入三角形三边的值,中间用英文逗号分隔:", "输入", "3,4,5")If nStr = "" Then Exit Suba = Val(nStr)S = ...
东昌府区15747516286: 设计一个简单的VB程序 - ?
僪炒复方: 变量定义在最上面,最好变量名x,y换别的x1,y1等 Dim x1 As Integer Private Sub Command1_Click()'+按钮 x1 = x1 + 1 Me.Caption = x1 End Sub Private Sub Command2_Click()'-按钮 x1= x1 - 1 Me.Caption = x1 End Sub
东昌府区15747516286: 简单VB程序设计 - ?
僪炒复方: 分太低,不过还是给你做了 Option Base 1 Private Type StuStuName As StringStuEnglish As StringStuMath As StringStuChem As StringStuPhys As String End Type Dim StuFile() As Stu Dim Counter As IntegerPrivate Sub Command1_...
东昌府区15747516286: 求写一简单的VB程序!谢!高手进?
僪炒复方: 其实你直接用FileListBox控件就可以了.如图所示: 这个就是文件列表控件. 在窗体上添加这个控件,然后写代码: private sub form_load()File1.pattern = "*.*" '*.*代表所有文件.如果单一是想要显示txt文件类型的话,就改为 *.txtFile1.path...
东昌府区15747516286: 求设计个简单的VB程序 - ?
僪炒复方: 主要代码Private Sub Command1_Click()D = InputBox("请输入圆的直径")S = 3.1415926 / 4 * D ^ 2L = 3.1415926 * DMsgBox ("圆的面积" & S 圆的周长...
东昌府区15747516286: 请各位帮忙做一个简单的VB程序 - ?
僪炒复方: Private Sub Command1_Click() Dim a, b, c a = Val(Text1.Text) b = Val(Text2.Text) c = Val(Text3.Text) If (a + b + c) / 3 >= 95 Then If (a = 100 And b = 100 And c >= 80) Or (a = 100 And c = 100 And b >= 80) Or (b = 100 And c = 100 And a >= 80) Then Label4.Caption = "一等奖" End If End If End Sub
东昌府区15747516286: 高手来帮忙写个简单的vb代码??
僪炒复方: Private Function GYS(k1 As Long, k2 As Long) As Long If k1 > k2 Then s = k1: k1 = k2: k2 = s Do r = k2 Mod k1 aa = k1 k2 = r If k1 > k2 Then s = k1: k1 = k2: k2 = s Loop While r <> 0 GYS = aa End Function Private Sub Command1_Click() Dim k1 ...
东昌府区15747516286: 求一段简单的VB代码,高手来! - ?
僪炒复方: 简单方法:Private Sub Form_Load() If App.PrevInstance = True Then MsgBox "已经启动了这个程序,不能重复启动" End End If Form1.Show End Sub