vb.net转速表 vb表达式转换器

vb.net怎么使用表格控件?DataGridView控件,放一个DataGridView1和Button1到窗体,下面是按钮下代码\x0d\x0aPrivate Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click\x0d\x0aMe.DataGridView1.AllowUserToAddRows = False\x0d\x0aDataGridView1.RowTemplate.Height = 200\x0d\x0aDataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None\x0d\x0aFor i = 1 To 3\x0d\x0aMe.DataGridView1.Columns.Add("列"i.ToString, "列"i.ToString)\x0d\x0aMe.DataGridView1.Rows.Add()\x0d\x0aNext\x0d\x0aMe.DataGridView1.Columns(0).Width = 100\x0d\x0aMe.DataGridView1.Columns(1).Width = 500\x0d\x0aMe.DataGridView1.Columns(0).Width = 300\x0d\x0aEnd Sub\x0d\x0a'自己设置相关需要的属性即可
用vb.net 怎样建立一个mdb数据库及一张表首先在项目的VB.NET界面,使用菜单【项目】--【添加引用】--【COM】
选择Microsoft ADO Ext. 2.x for DDL and Security
然后单击【确定】,完成引用 。
完整代码如下:
Imports ADOX
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'创建空的access数据库文件--数据库文件.mdb,密码为123
Dim Mycat As Catalog = New Catalog()
Mycat.Create("Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=5;Data Source= 数据库文件.mdb;Jet OLEDB:Database Password=123")
'以下代码创建一个名为“实验数据表”
Dim MyTable As ADOX.Table = New ADOX.Table'定义新表
MyTable.Name = "实验数据表"'表命名
'给表“实验数据表” 创建一个字符串字段,字段名“姓名”
MyTable.Columns.Append("姓名", , ADOX.DataTypeEnum.adWChar)
'给表“实验数据表” 创建一个整数字段,字段名“学号”
MyTable.Columns.Append("学号", ADOX.DataTypeEnum.adInteger)'追加一个数字型字段
'给字段“学号”创建一个主键“PimaryKey_Field”
MyTable.Keys.Append("学号", ADOX.KeyTypeEnum.adKeyPrimary, "学号")
Mycat.Tables.Append(MyTable) '把所有的新字段追加到表
MyTable = Nothing
Mycat = Nothing
End Sub
End Class
怎样用vb.net作一个指针转动的钟表?(可设置时间日期,有闹铃功能)你需要会用GDI ,也就是那个System.Drawing命名空间下的类.
给你说个思路,设Timer,到时间就用Form.Invalidate()函数重画窗口,在重画窗口的Form_Paint事件下面编写代码得到当前时间,再根据当前时间用GDI 画时钟.
用VB.NET设计一个以秒为基本单位的表,并且显示在窗体上的步骤,并且给出关键代码是我以前自己设计的用来测试自己点钞速度用的 , 希望是你需要的
以下是窗体的全部代码
Public Class Form1
Dim StartFlag As Boolean = False
Dim secon As Integer
Dim minut As Integer
'空格
Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
If e.KeyCode = Keys.Space Then
If StartFlag Then
StartFlag = False
Timer1.Enabled = False
If Val(Strings.Right(Label1.Text, 2))10 And Val(Strings.Right(Label1.Text, 2)) = 0 Then secon = 0 : minut = 0 : Label1.Text = "00:00" : Exit Sub
ListBox1.Items.Add(Label1.Text.ToString)
ListBox1.SelectedItem = ListBox1.Items.Count - 1
Label1.Focus()
Button1.Enabled = True
Label1.Text = "00:00"
secon = 0
minut = 0
Else
StartFlag = True
Timer1.Enabled = True
End If
End If
End Sub
'加载
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ListBox1.Items.Clear()
Label1.Text = "00:00"
Button1.Enabled = False
secon = 0
minut = 0
Label1.Focus()
End Sub
'清空
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Button1.Enabled = False
ListBox1.Items.Clear()
Label1.Focus()
【vb.net转速表 vb表达式转换器】End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
secon= 1
If secon = 60 Then
secon = 0
minut= 1
End If
Dim seconStr As String = secon
If seconStr.Length = 1 Then seconStr = "0"seconStr
Dim minutStr As String = minut
If minutStr.Length = 1 Then minutStr = "0"minutStr
Label1.Text = minutStr":"seconStr
Label1.Focus()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim SeconSun As Integer
If ListBox1.Items.Count0 Then
For i = 0 To ListBox1.Items.Count - 1
Dim TemStr As String = ListBox1.Items.Item(i).ToString
Dim TemInt1 As Integer = Val(Strings.Right(TemStr, 2))
Dim TemInt2 As Integer = Val(Strings.Left(TemStr, 2))
Debug.Print(TemInt1.ToString)
Debug.Print(TemInt2.ToString)
SeconSun= TemInt1TemInt2 * 60
Debug.Print(SeconSun.ToString)
Next
TextBox1.Text = (SeconSun / ListBox1.Items.Count).ToString"秒"
End If
Label1.Focus()
End Sub
End Class
关于vb.net转速表和vb表达式转换器的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

    推荐阅读