vb.net程序代码大全 vbnet function
求VB.net程序源代码 绘图板、二十一点游戏、计算器、井字棋游戏、屏幕保护程序等
说明:1.共有4个文本框其,其中三个是填入或输出数据的(名称分别是:txta txtb txtc),剩下的那个是符号(txtd)2.共7个按钮,4个是符号按钮,一个计算,一个清零.这是我弄的程序”袖珍计算器”代码也是自己编写的,代码如下:通用声明Dim j As Integer '定义j为整型
站在用户的角度思考问题,与客户深入沟通,找到南城网站设计与南城网站推广的解决方案,凭借多年的经验,让设计与互联网技术结合,创造个性化、用户体验好的作品,建站类型包括:成都网站设计、网站制作、企业官网、英文网站、手机端网站、网站推广、域名与空间、虚拟空间、企业邮箱。业务覆盖南城地区。
Private Sub Text1_Change()End SubPrivate Sub Command1_Click()
txtfuhao.Text = "+" '将”+”显示到文本框txtfuhao.Text中
End SubPrivate Sub Command2_Click()
txtfuhao.Text = "-" ''将”-”显示到文本框txtfuhao.Text中
End SubPrivate Sub Command3_Click()
txtfuhao.Text = "×" '将”×”显示到文本框txtfuhao.Text中
End SubPrivate Sub Command4_Click()
txtfuhao.Text = "÷" 将”÷”'显示到文本框txtfuhao.Text中
End Sub
Private Sub Command5_Click()
Dim a, b, c As Integer
a = Val(txta.Text) '将txta.Text里的内容转化为数值型,然后再赋给a
b = Val(txtb.Text) '将txtb.Text里的内容转化为数值型,然后再赋给b
If txtfuhao.Text = "+" Then '运算过程
c = a + b '运算过程
ElseIf txtfuhao.Text = "-" Then '运算过程
c = a - b '运算过程
ElseIf txtfuhao.Text = "÷" Then '运算过程
c = a / b '运算过程
ElseIf txtfuhao.Text = "×" Then '运算过程
c = a * b '运算过程
Else
j = MsgBox("您输入的符号不正确", vbOKOnly, "错误信息")
End If
txtc.Text = c '将运算结果c输出到文本框txtc中
End SubPrivate Sub Command6_Click()
txta.Text = "" '将空字符输入到文本框内(刷新)
txtb.Text = "" '将空字符输入到文本框内(刷新)
txtc.Text = "" '将空字符输入到文本框内(刷新)
txtfuhao.Text = "" '将空字符输入到文本框内(刷新)
End SubPrivate Sub Command7_Click()
End '结束程序
End SubPrivate Sub Form_Load()End Sub
VB.NET中的代码
大概的过程:
Imports System.Data
Imports System.Data.SqlClient
--------------
Dim a As New SqlDataAdapter
Dim con As SqlConnection
con = New SqlConnection( "Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=.;Connect Timeout=30")
con.Open()
a.SelectCommand = New SqlCommand("select * from table where c=1", con)
a.UpdateCommand = New SqlCommand("update table set b=2 where c=1", con)
a.DeleteCommand = New SqlCommand("delete from table where c=1", con)
a.InsertCommand = New SqlCommand("insert into table values (1,2,3)", con)
a.SelectCommand.ExecuteNonQuery()
a.UpdateCommand.ExecuteNonQuery()
a.DeleteCommand.ExecuteNonQuery()
a.InsertCommand.ExecuteNonQuery()
con.Close()
a.Dispose()
急求以下vb.net代码
'我不会计时,因此下面代码中没有计时功能,要你自己去创建。
'Text1 As Label , Sui1 As Button , Sui2 As Button , Sui3 As Button , Fil1 As TextBox , Form1 As Form.
Public Class Form1
Private Sub Sui1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Sui1.Click
Dim i As Random = New Random
Dim iText As String = ""
For mn As Int16 = 1 To 30
Dim si As Int16 = i.Next(0, 25)
If si = 0 Then
iText += "a"
ElseIf si = 1 Then
iText += "b"
ElseIf si = 2 Then
iText += "c"
ElseIf si = 3 Then
iText += "d"
ElseIf si = 4 Then
iText += "e"
ElseIf si = 5 Then
iText += "f"
ElseIf si = 6 Then
iText += "g"
ElseIf si = 7 Then
iText += "h"
ElseIf si = 8 Then
iText += "i"
ElseIf si = 9 Then
iText += "j"
ElseIf si = 10 Then
iText += "k"
ElseIf si = 11 Then
iText += "l"
ElseIf si = 12 Then
iText += "m"
ElseIf si = 13 Then
iText += "n"
ElseIf si = 14 Then
iText += "o"
ElseIf si = 15 Then
iText += "p"
ElseIf si = 16 Then
iText += "q"
ElseIf si = 17 Then
iText += "r"
ElseIf si = 18 Then
iText += "s"
ElseIf si = 19 Then
iText += "t"
ElseIf si = 20 Then
iText += "u"
ElseIf si = 21 Then
iText += "v"
ElseIf si = 22 Then
iText += "w"
ElseIf si = 23 Then
iText += "x"
ElseIf si = 24 Then
iText += "y"
ElseIf si = 25 Then
iText += "z"
End If
Next
Text1.Text = iText
Sui1.Enabled = False
Sui2.Enabled = True
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Fil1.Enabled = False
Sui2.Enabled = False
Sui3.Enabled = False
End Sub
Private Sub Sui2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Sui2.Click
Fil1.Enabled = True
Sui3.Enabled = True
Fil1.Select()
End Sub
Private Sub Fil1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Fil1.TextChanged
If Fil1.Text.Count = Fil1.MaxLength Then
Fil1.Enabled = False
End If
End Sub
Private Sub Sui3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Sui3.Click
Fil1.Enabled = False
Sui2.Enabled = False
Sui1.Enabled = True
Sui3.Enabled = False
'完成结果。
MsgBox("suidu:" 30)
End Sub
End Class
跪求vb.net代码
新建窗口,添加picture控件
利用line()方法画线
line(开始x坐标,开始y坐标)-(结束x坐标,结束y坐标),线的颜色,画线的方式(默认为线,B为矩形无填充,BF为填充的矩形)
For i = 1 To 16
Picture1.Line (0, Picture1.Height / 2)-(i * (Picture1.Width / 16), 0), RGB(255, 0, 0)
Picture1.Line (0, Picture1.Height / 2)-(i * (Picture1.Width / 16), Picture1.Height), RGB(255, 0, 0)
Picture1.Line (Picture1.Width, Picture1.Height / 2)-(i * (Picture1.Width / 16), 0), RGB(0, 255, 0)
Picture1.Line (Picture1.Width, Picture1.Height / 2)-(i * (Picture1.Width / 16), Picture1.Height), RGB(0, 255, 0)
Next i
如果要在窗口上画也可以调用窗口的line方法即form.line()
本文题目:vb.net程序代码大全 vbnet function
分享URL:http://azwzsj.com/article/dogigsc.html