dim a as singer
創(chuàng)新互聯(lián)公司于2013年創(chuàng)立,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢想脫穎而出為使命,1280元臨清做網(wǎng)站,已為上家服務(wù),為臨清各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:028-86922220
dim b as singer 定義a,b 為單精度型
a=text1.text 將輸入文本框1的賦給A 我看不懂textbox是什么 不好意思
b=text2.text 將輸入文本框2的賦給b
text3.text=a+b 講a+b的值賦給text3.text
應(yīng)該就是這樣 我的QQ是349141013 我正在學(xué)習(xí)VB中 希望可以和你交流
Public a As Short = 1
按鈕事件:
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
a = a + 1
Label1.Text = a
End Sub
這樣寫出來只能加一次,再單擊就不管用了,Lable1里一直顯示為2.
望采納,謝謝??!
Private WithEvents NewTextBox As TextBox
'通過使用WithEvents關(guān)鍵字聲明一個(gè)對(duì)象變量為新的命令按鈕
Private Sub Command1_Click()
If NewTextBox Is Nothing Then
Set NewTextBox = Controls.Add("VB.TextBox", "cmdNew", Form1)
NewTextBox.Move 200, 200
NewTextBox.Width = Form1.Width - 450
NewTextBox.Height = Form1.Height - 1400
NewTextBox.Visible = True
End If
End Sub
Private Sub Command2_Click()
If NewTextBox Is Nothing Then
Exit Sub
Else
Controls.Remove NewTextBox
Set NewTextBox = Nothing
End If
End Sub
html
head
meta http-equiv="Content-Type" content="text/html; charset=utf-8" /
title1到100之和/title
/head
script language="javascript"
!--
sum=0
for(i=1;i=100;i++)
{
sum=sum+i;
}
document.write("1到100之和為:"+sum)
--
/script
body
/body
/html
Dim Text() As Object
Private Sub Form_Load()
Dim i As Integer
Dim nTop As Long
ReDim Text(1 To 10)
For i = 1 To 10
Set Text(i) = Controls.Add("VB.TextBox", "Text1" CStr(i))
Text(i).Height = 300
Text(i).Top = nTop
Text(i).Visible = True
nTop = nTop + 30 * 15
Next i
End Sub
添加動(dòng)態(tài)控件。你可以自己試試看。 form1上什么都不加運(yùn)行這個(gè)程序后會(huì)發(fā)現(xiàn)自動(dòng)生成了10個(gè)text控件
很簡單,點(diǎn)擊菜單“項(xiàng)目”--“WindowsApplication1屬性”
在屬性面板里點(diǎn)“資源”,這里可添加字符串資源、圖片資源、多媒體資源等等。
使用資源很簡單,舉例如下:
? Label1.Text = My.Resources.String1
? PictureBox1.Image = My.Resources.小貓