| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1349 人关注过本帖
标题:[求助]程序设计的一道题,做个系统!急!
只看楼主 加入收藏
ty285
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2006-6-10
收藏
 问题点数:0 回复次数:8 
[求助]程序设计的一道题,做个系统!急!

我也是帮朋友的忙,希望大家能帮帮忙,谢谢大家了,我的QQ是565602688,希望能做出来的朋友上传过来!谢谢了!

一. 首先在D盘(或由监考教师指定位置)创建一个考生文件夹,名字为完整的学号-姓名。如某考生的学号为005702001,姓名为“王力”,则文件夹的名称应为“005702001-王力”。(5分)
二. 在VB中新建一个工程,并在该工程中创建4个窗体。每个窗体及其实现的功能如下:(60分)
1. 在窗体1中创建如图1所示的内容,其中标题栏上显示的标题为考生的姓名。单击【第1题】按钮时,打开“第1题”的窗体;单击【第2题】按钮时,打开“第2题”的窗体;单击【第3题】按钮时,打开“第3题”的窗体。(10分)

图1

2. 第1题,编写一个在窗体大小和颜色变化的圆。并且在圆上显示变化的文字“您好”。其中变化次数通过输入框由用户指定,见图2。(20分)

图2
3. 第2题,窗体的内容如图2所示。当分别在文本框1和文本框2中输入数字后,单击其中的【计算】按钮时,在文本框3中显示文本框1和文本框2中数字求和的计算结果;单击【结束】按钮时,关闭该窗体。(20分)

图2
4. 第3题要求在窗体标题栏中显示“第3题”。单击窗体则在窗体上输出一个“数字金字塔”,即第1行为1个数字1,第2行为2个数字2,……,最后一行为9个数字9。要求输出的格式为居中对齐。(10分)

完成工程及其窗体的全部功能后,将其保存在考生文件夹中。最后将工程生成可执行文件,名字为考生的姓名,并保存在考生文件夹中。(15分)


图2


图3


[此贴子已经被作者于2007-11-3 16:34:10编辑过]

搜索更多相关主题的帖子: 程序设计 系统 窗体 王力 考生 
2007-11-03 16:25
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
第一题不会做的话……你可以不用问了。
2007-11-03 18:26
ty285
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2006-6-10
收藏
得分:0 
大哥 你帮帮忙吧,第一题当然能做,我这不是整个给粘过来了吗! 谢谢了!

2007-11-03 20:07
fairy4
Rank: 4
等 级:贵宾
威 望:10
帖 子:738
专家分:267
注 册:2007-11-1
收藏
得分:0 

FORM1窗體代碼
Imports System.IO
Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form 設計工具產生的程式碼 "

Public Sub New()
MyBase.New()

'此為 Windows Form 設計工具所需的呼叫。
InitializeComponent()

'在 InitializeComponent() 呼叫之後加入所有的初始設定

End Sub

'Form 覆寫 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 Form 設計工具的必要項
Private components As System.ComponentModel.IContainer

'注意: 以下為 Windows Form 設計工具所需的程序
'您可以使用 Windows Form 設計工具進行修改。
'請勿使用程式碼編輯器來修改這些程序。
Friend WithEvents txtName As System.Windows.Forms.TextBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents txtNo As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.txtName = New System.Windows.Forms.TextBox
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.txtNo = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.Button4 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'txtName
'
Me.txtName.Location = New System.Drawing.Point(88, 16)
Me.txtName.Name = "txtName"
Me.txtName.TabIndex = 0
Me.txtName.Text = ""
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(8, 16)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(56, 23)
Me.Label1.TabIndex = 1
Me.Label1.Text = "姓名"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(8, 72)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(56, 23)
Me.Label2.TabIndex = 2
Me.Label2.Text = "學號"
'
'txtNo
'
Me.txtNo.Location = New System.Drawing.Point(88, 64)
Me.txtNo.Name = "txtNo"
Me.txtNo.TabIndex = 3
Me.txtNo.Text = ""
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(240, 24)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(96, 24)
Me.Button1.TabIndex = 4
Me.Button1.Text = "創建文件夾"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(88, 120)
Me.Button2.Name = "Button2"
Me.Button2.TabIndex = 5
Me.Button2.Text = "第一題"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(88, 160)
Me.Button3.Name = "Button3"
Me.Button3.TabIndex = 6
Me.Button3.Text = "第二題"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(88, 200)
Me.Button4.Name = "Button4"
Me.Button4.TabIndex = 7
Me.Button4.Text = "第三題"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 15)
Me.ClientSize = New System.Drawing.Size(400, 301)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.txtNo)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.txtName)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sDirName, strName, strNO As String
strName = Me.txtName.Text.Trim()
strNO = Me.txtNo.Text.Trim()
If strName = String.Empty Or strNO = String.Empty Then
MsgBox("姓名和學號不能為空")
Exit Sub
End If

sDirName = "D:\" & strNO & "-" & strName
Dim dDir As New DirectoryInfo(sDirName)


If Not dDir.Exists Then '檢查該文件夾是否存在,不存在則建立

System.IO.Directory.CreateDirectory(sDirName)
MsgBox("創建成功")
Else
MsgBox("該文件夾已經存在")

End If
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Text = "fairy4"
End Sub

Private Sub txtName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtName.TextChanged
Me.Text = Me.txtName.Text.Trim()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim fm As New Form2
fm.Show()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim fm As New Form3
fm.Show()
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim fm As New Form4
fm.Show()
End Sub
End Class


一个人只有一个心脏,却有两个心房。一个住着快乐;一个住着悲伤。不要笑得太大声,不然会吵醒旁边的悲伤
2007-11-05 10:49
fairy4
Rank: 4
等 级:贵宾
威 望:10
帖 子:738
专家分:267
注 册:2007-11-1
收藏
得分:0 

窗體2代碼
Imports System.Drawing.Drawing2D
Imports System.Drawing

Public Class Form2
Inherits System.Windows.Forms.Form

#Region " Windows Form 設計工具產生的程式碼 "

Public Sub New()
MyBase.New()

'此為 Windows Form 設計工具所需的呼叫。
InitializeComponent()

'在 InitializeComponent() 呼叫之後加入所有的初始設定

End Sub

'Form 覆寫 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 Form 設計工具的必要項
Private components As System.ComponentModel.IContainer

'注意: 以下為 Windows Form 設計工具所需的程序
'您可以使用 Windows Form 設計工具進行修改。
'請勿使用程式碼編輯器來修改這些程序。
Friend WithEvents Timer1 As System.Windows.Forms.Timer
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
'
'Timer1
'
Me.Timer1.Enabled = True
Me.Timer1.Interval = 2000
'
'Form2
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 15)
Me.ClientSize = New System.Drawing.Size(320, 325)
Me.Name = "Form2"
Me.Text = "Form2"

End Sub

#End Region


Dim _BorderColor As Color
Dim _FillAngle As Integer = 90


Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Form2_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim x As Integer
Randomize()
Application.DoEvents()

x = Rnd() * 200 + 100

Dim g As Graphics = e.Graphics
Dim mypen As Pen = New Pen(Color.Red, 2)
Dim rec1 As RectangleF = New RectangleF(10, 10, x, x)
g.DrawEllipse(mypen, rec1)
'Dim brush As New LinearGradientBrush(rec1, Color.Coral, Color.Blue, _FillAngle)
'e.Graphics.FillRectangle(brush, rec1)
'*************
Dim FFamily As FontFamily = New FontFamily("Arial")
Dim font As Font = New Font(FFamily, "20", FontStyle.Bold, FontStyle.Italic, GraphicsUnit.Pixel)
Dim text As String = "你好!"
Dim solidbrush As SolidBrush = New SolidBrush(Color.Red)
Dim pr As PointF = New PointF(x / 2 - 5, x / 2 - 5)
e.Graphics.DrawString(text, font, solidbrush, pr)

'*************



End Sub

Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Refresh() '
End Sub
End Class


一个人只有一个心脏,却有两个心房。一个住着快乐;一个住着悲伤。不要笑得太大声,不然会吵醒旁边的悲伤
2007-11-05 10:49
fairy4
Rank: 4
等 级:贵宾
威 望:10
帖 子:738
专家分:267
注 册:2007-11-1
收藏
得分:0 

Public Class Form3
Inherits System.Windows.Forms.Form

#Region " Windows Form 設計工具產生的程式碼 "

Public Sub New()
MyBase.New()

'此為 Windows Form 設計工具所需的呼叫。
InitializeComponent()

'在 InitializeComponent() 呼叫之後加入所有的初始設定

End Sub

'Form 覆寫 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 Form 設計工具的必要項
Private components As System.ComponentModel.IContainer

'注意: 以下為 Windows Form 設計工具所需的程序
'您可以使用 Windows Form 設計工具進行修改。
'請勿使用程式碼編輯器來修改這些程序。
Friend WithEvents a As System.Windows.Forms.TextBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents c As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents b As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.a = New System.Windows.Forms.TextBox
Me.Label1 = New System.Windows.Forms.Label
Me.b = New System.Windows.Forms.TextBox
Me.Label2 = New System.Windows.Forms.Label
Me.c = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'a
'
Me.a.Location = New System.Drawing.Point(8, 32)
Me.a.Name = "a"
Me.a.TabIndex = 0
Me.a.Text = ""
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(120, 32)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(24, 23)
Me.Label1.TabIndex = 1
Me.Label1.Text = "+"
'
'b
'
Me.b.Location = New System.Drawing.Point(168, 32)
Me.b.Name = "b"
Me.b.TabIndex = 2
Me.b.Text = ""
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(8, 72)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(24, 23)
Me.Label2.TabIndex = 3
Me.Label2.Text = "="
'
'c
'
Me.c.Location = New System.Drawing.Point(56, 72)
Me.c.Name = "c"
Me.c.TabIndex = 4
Me.c.Text = ""
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(24, 184)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 5
Me.Button1.Text = "計算"
'
'Form3
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 15)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.c)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.b)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.a)
Me.Name = "Form3"
Me.Text = "Form3"
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x, y, z As Integer

x = Val(Me.a.Text.Trim())
y = Val(Me.b.Text.Trim())

z = x + y
Me.c.Text = z
End Sub
End Class


一个人只有一个心脏,却有两个心房。一个住着快乐;一个住着悲伤。不要笑得太大声,不然会吵醒旁边的悲伤
2007-11-05 10:50
fairy4
Rank: 4
等 级:贵宾
威 望:10
帖 子:738
专家分:267
注 册:2007-11-1
收藏
得分:0 

Public Class Form4
Inherits System.Windows.Forms.Form

#Region " Windows Form 設計工具產生的程式碼 "

Public Sub New()
MyBase.New()

'此為 Windows Form 設計工具所需的呼叫。
InitializeComponent()

'在 InitializeComponent() 呼叫之後加入所有的初始設定

End Sub

'Form 覆寫 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 Form 設計工具的必要項
Private components As System.ComponentModel.IContainer

'注意: 以下為 Windows Form 設計工具所需的程序
'您可以使用 Windows Form 設計工具進行修改。
'請勿使用程式碼編輯器來修改這些程序。
Friend WithEvents Label1 As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(16, 24)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(272, 192)
Me.Label1.TabIndex = 0
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Form4
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 15)
Me.ClientSize = New System.Drawing.Size(328, 273)
Me.Controls.Add(Me.Label1)
Me.Name = "Form4"
Me.Text = "第三題"
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Form4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Click
Me.Label1.Visible = True
End Sub

Private Sub Form4_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Label1.Visible = False
Dim temp, strTemp As String
Dim x, i As Integer
For x = 1 To 9
temp = ""
For i = 1 To x
temp = temp & x
Next
strTemp = strTemp & temp & vbCrLf
Next
Me.Label1.Text = strTemp
End Sub
End Class


一个人只有一个心脏,却有两个心房。一个住着快乐;一个住着悲伤。不要笑得太大声,不然会吵醒旁边的悲伤
2007-11-05 10:50
fairy4
Rank: 4
等 级:贵宾
威 望:10
帖 子:738
专家分:267
注 册:2007-11-1
收藏
得分:0 

我的系統是繁體的,就算把原代碼給你,你也看不 了,你自己建立一個 工程,把它編譯下就可以了!


環境為 vb.net2003,
作這種沒有任何技巧的 事情,實在。。。。

當我無聊邦下你吧,你 應該會在WORD中繁體轉換成簡體吧
另問下斑竹,第一題,你是怎么做的?
在D盤下新建立一個 文件夾,然后更改名稱???????

hEhWFMN9.rar (45.91 KB)

附件為源代碼,繁體的!!

[此贴子已经被作者于2007-11-5 11:04:35编辑过]


一个人只有一个心脏,却有两个心房。一个住着快乐;一个住着悲伤。不要笑得太大声,不然会吵醒旁边的悲伤
2007-11-05 10:55
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
我啊……调用cmd。
2007-11-05 12:59
快速回复:[求助]程序设计的一道题,做个系统!急!
数据加载中...
 
   



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

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