| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 692 人关注过本帖
标题:初学者求助看下此代码的错误
只看楼主 加入收藏
huangfeimei
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-5-24
收藏
 问题点数:0 回复次数:9 
初学者求助看下此代码的错误

Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub tijiao_()
#Region(" Windows 窗体设计器生成的代码 ")
Private Sub new()

MyBase.New()

'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()

'在 InitializeComponent() 调用之后添加任何初始化

End Sub

'窗体重写 dispose 以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer

'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents CheckBox1 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox2 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox3 As System.Windows.Forms.CheckBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents RadioButton1 As System.Windows.Forms.RadioButton
Friend WithEvents RadioButton2 As System.Windows.Forms.RadioButton
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents tijiao As System.Windows.Forms.Button
Friend WithEvents txtxingming As System.Windows.Forms.TextBox
Friend WithEvents txtnianlin As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.txtxingming = New System.Windows.Forms.TextBox
Me.txtnianlin = New System.Windows.Forms.TextBox
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.Label5 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.CheckBox3 = New System.Windows.Forms.CheckBox
Me.CheckBox2 = New System.Windows.Forms.CheckBox
Me.CheckBox1 = New System.Windows.Forms.CheckBox
Me.GroupBox2 = New System.Windows.Forms.GroupBox
Me.Label7 = New System.Windows.Forms.Label
Me.Label6 = New System.Windows.Forms.Label
Me.RadioButton2 = New System.Windows.Forms.RadioButton
Me.RadioButton1 = New System.Windows.Forms.RadioButton
Me.tijiao = New System.Windows.Forms.Button
Me.Label8 = New System.Windows.Forms.Label
Me.GroupBox1.SuspendLayout()
Me.GroupBox2.SuspendLayout()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label1.Location = New System.Drawing.Point(40, 32)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(56, 32)
Me.Label1.TabIndex = 1
Me.Label1.Text = "姓名"
'
'Label2
'
Me.Label2.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label2.Location = New System.Drawing.Point(40, 96)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(56, 24)
Me.Label2.TabIndex = 3
Me.Label2.Text = "年龄"
'
'txtxingming
'
Me.txtxingming.Location = New System.Drawing.Point(112, 32)
Me.txtxingming.Name = "txtxingming"
Me.txtxingming.Size = New System.Drawing.Size(112, 26)
Me.txtxingming.TabIndex = 2
Me.txtxingming.Text = ""
'
'txtnianlin
'
Me.txtnianlin.Location = New System.Drawing.Point(112, 88)
Me.txtnianlin.Name = "txtnianlin"
Me.txtnianlin.Size = New System.Drawing.Size(112, 26)
Me.txtnianlin.TabIndex = 4
Me.txtnianlin.Text = ""
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.Label5)
Me.GroupBox1.Controls.Add(Me.Label4)
Me.GroupBox1.Controls.Add(Me.Label3)
Me.GroupBox1.Controls.Add(Me.CheckBox3)
Me.GroupBox1.Controls.Add(Me.CheckBox2)
Me.GroupBox1.Controls.Add(Me.CheckBox1)
Me.GroupBox1.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.GroupBox1.Location = New System.Drawing.Point(264, 24)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(168, 192)
Me.GroupBox1.TabIndex = 5
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "兴趣爱好"
'
'Label5
'
Me.Label5.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label5.Location = New System.Drawing.Point(64, 128)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(48, 16)
Me.Label5.TabIndex = 5
Me.Label5.Text = "拳击"
'
'Label4
'
Me.Label4.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label4.Location = New System.Drawing.Point(64, 80)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(48, 24)
Me.Label4.TabIndex = 4
Me.Label4.Text = "击剑"
'
'Label3
'
Me.Label3.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label3.Location = New System.Drawing.Point(64, 32)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(64, 16)
Me.Label3.TabIndex = 3
Me.Label3.Text = "游泳"
'
'CheckBox3
'
Me.CheckBox3.Location = New System.Drawing.Point(24, 128)
Me.CheckBox3.Name = "CheckBox3"
Me.CheckBox3.Size = New System.Drawing.Size(16, 16)
Me.CheckBox3.TabIndex = 3
Me.CheckBox3.Text = "CheckBox3"
'
'CheckBox2
'
Me.CheckBox2.Location = New System.Drawing.Point(24, 80)
Me.CheckBox2.Name = "CheckBox2"
Me.CheckBox2.Size = New System.Drawing.Size(16, 16)
Me.CheckBox2.TabIndex = 2
Me.CheckBox2.Text = "CheckBox2"
'
'CheckBox1
'
Me.CheckBox1.Location = New System.Drawing.Point(24, 40)
Me.CheckBox1.Name = "CheckBox1"
Me.CheckBox1.Size = New System.Drawing.Size(16, 8)
Me.CheckBox1.TabIndex = 1
Me.CheckBox1.Text = "CheckBox1"
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.Label7)
Me.GroupBox2.Controls.Add(Me.Label6)
Me.GroupBox2.Controls.Add(Me.RadioButton2)
Me.GroupBox2.Controls.Add(Me.RadioButton1)
Me.GroupBox2.Location = New System.Drawing.Point(40, 136)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(184, 80)
Me.GroupBox2.TabIndex = 6
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "性别"
'
'Label7
'
Me.Label7.Location = New System.Drawing.Point(48, 32)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(40, 16)
Me.Label7.TabIndex = 1
Me.Label7.Text = "男"
'
'Label6
'
Me.Label6.Location = New System.Drawing.Point(136, 32)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(32, 16)
Me.Label6.TabIndex = 3
Me.Label6.Text = "女"
'
'RadioButton2
'
Me.RadioButton2.Location = New System.Drawing.Point(112, 32)
Me.RadioButton2.Name = "RadioButton2"
Me.RadioButton2.Size = New System.Drawing.Size(16, 16)
Me.RadioButton2.TabIndex = 2
Me.RadioButton2.Text = "RadioButton2"
'
'RadioButton1
'
Me.RadioButton1.Location = New System.Drawing.Point(16, 32)
Me.RadioButton1.Name = "RadioButton1"
Me.RadioButton1.Size = New System.Drawing.Size(16, 16)
Me.RadioButton1.TabIndex = 0
Me.RadioButton1.Text = "RadioButton1"
'
'tijiao
'
Me.tijiao.Image = CType(resources.GetObject("tijiao.Image"), System.Drawing.Image)
Me.tijiao.Location = New System.Drawing.Point(40, 240)
Me.tijiao.Name = "tijiao"
Me.tijiao.Size = New System.Drawing.Size(112, 32)
Me.tijiao.TabIndex = 7
Me.tijiao.Text = "提交"
'
'Label8
'
Me.Label8.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.Label8.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Label8.Location = New System.Drawing.Point(24, 296)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(408, 112)
Me.Label8.TabIndex = 4
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(9, 19)
Me.BackColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(192, Byte), CType(255, Byte))
Me.ClientSize = New System.Drawing.Size(456, 421)
Me.Controls.Add(Me.Label8)
Me.Controls.Add(Me.tijiao)
Me.Controls.Add(Me.GroupBox2)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.txtnianlin)
Me.Controls.Add(Me.txtxingming)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Name = "Form1"
Me.Text = "人员调查表"
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox2.ResumeLayout(False)
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub tijiao_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tijiao.Click
Dim strname As String '用来存放姓名
Dim strage As String '用来存放年龄
Dim strsex As String '用来存放性别
Dim strinterest As String '用来存放兴趣
'给变量赋值
strname = txtxingming.Text
strage = txtnianlin.Text
'对性别作出判别,并给变量strsex赋值
If RadioButton1.Checked = True Then
strsex = "男"
Else
strsex = "女"

End If
'对兴趣爱好作判别,并给变量strintetest赋值
If CheckBox1.Checked = True Then '判别是否选择了游泳

strinterest = strinterest + "游泳"

End If
If CheckBox2.Checked = True Then '判别是否选择了击剑
If strinterest <> "" Then
strinterest = strinterest + "'" + "击剑"
Else
strinterest = strinterest + "击剑"

End If

End If
If CheckBox3.Checked = True Then '判别是否选择了拳击
If strinterest <> "" Then
strinterest = strinterest + "'" + "拳击"
Else
strinterest = strinterest + "拳击"
End If
End If
'给标签Label8赋值,显示结果
Label8.Text = "姓名:" + strname + "," + "年龄:" + strage + "," + "性别:" + strsex + "," + "兴趣爱好:" + strinterest


End Sub
End Class

搜索更多相关主题的帖子: 代码 
2006-05-24 17:36
huangfeimei
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-5-24
收藏
得分:0 

怎么没人回答啊

2006-05-24 23:19
dachouyu
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2006-4-18
收藏
得分:0 

第3行没End Sub


2006-05-25 08:57
Tailor
Rank: 1
等 级:新手上路
帖 子:152
专家分:0
注 册:2005-6-26
收藏
得分:0 

你是不是想让我去猜你程序的错误,我想这不是你的本意.
你应该说一下你错在什么地方了,让大家帮你改一下.
我不喜欢去猜别人程序的错误.


2006-05-25 11:52
adair
Rank: 3Rank: 3
等 级:新手上路
威 望:9
帖 子:250
专家分:0
注 册:2005-9-3
收藏
得分:0 

无理取闹


********年轻无极限******** 要時刻相信你自己,不要被自己打敗
2006-05-25 21:19
迎风落泪
Rank: 1
等 级:新手上路
威 望:1
帖 子:200
专家分:0
注 册:2006-4-5
收藏
得分:0 
大哥你有没有搞错啊

你不会用插入断点调试一下啊

那来这么大的篇幅

好难找的啊
 

[此贴子已经被作者于2006-5-28 14:18:59编辑过]


一个小混混!!!!
2006-05-28 14:18
蓝魂
Rank: 1
等 级:新手上路
帖 子:39
专家分:0
注 册:2006-6-6
收藏
得分:0 

如果是没有搞错的话,是不是出现什么“算术溢出”,如果是的话建议重装vs.net,纯粹是软件出了问题,与代码无关.

2006-06-06 11:39
tangzheng
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-6-12
收藏
得分:0 

你以为错误这么容易找啊 ?
你这分明就是考大家吗 ?

2006-06-12 09:49
xuyanfeng
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2006-5-13
收藏
得分:0 

看完还真得有耐心才行 啊

2006-06-12 10:13
Enoch
Rank: 1
等 级:新手上路
帖 子:55
专家分:0
注 册:2006-4-26
收藏
得分:0 
胡搞!~

2006-06-12 14:40
快速回复:初学者求助看下此代码的错误
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030943 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved