医院信息管理系统论文 下载本文

保定科技职业学院论文设计

name Frmmain caption startuppositon statusbar name Panels( 1 ) Panels( 2 ) Panels( 3 )

用户管理界面

frmmain 门诊收费管理系统 centerscreen statusbar1 XbrText SrDate SbrTime

此界面为本系统中,较常用的一种界面结构。主要由最上方的工具条,中间的现有数据显示区及下方的新增内容区。

在系统细节,主要采用了一个ADO.recordset对象,当增加保存时,使用了其addnew及post方法;当删除某一行数据时,使用了其Delete,post方法。

用户管理窗体的界面如下图示

窗体用一个表格控件msf1exgrid,一个工具条控件too1bar,两个标签控件table组成。各控件的属性如下表

用户管理窗体中各个控件的属性设置 控件 Form 属性 name caption 属性取值 Frm用户管理 用户管理

第21 页

保定科技职业学院论文设计

startUpPositon Too1bar Name Appeatance Borderstyle Index 1 Index 2 Index 3 Index 4 MSFlexridg Lable1 Lable2

主要实现代码如下: Private Sub Form_Load()

Name 滚动条( S ) 选定模式( M ) Caption Caption CenterScreen Too1bar1 1-3D 1-ccfixedSngle 增加 删除 修改 退出 Datagrid 3-Both 1-By Row 用户名 密码 允许用户调整大小( U ) 3-Both Call ExcuteSql(rec_user, \Call ShowInfo(rec_user, flexb) End Sub

Public Sub ShowInfo(ByVal rs As ADODB.Recordset, ByVal searchList As MSHFlexGrid)

On Error Resume Next Dim SumFields, i, j

SumFields = rs.Fields.Count '该表的字段总数

searchList.Clear '清空列表,防止增加或修改调用时重复显示 'searchList.BackColor = &HC0FFFF '设置网格背景颜色 searchList.Cols = SumFields '设置网格列数 searchList.Row = 0 With searchList

.FillStyle = flexFillSingle '.ScrollTrack = True

'.AllowUserResizing = flexResizeColumns .FixedRows = 1 .FixedCols = 0

.SelectionMode = flexSelectionByRow

第22 页

保定科技职业学院论文设计

End With

'设置第一行的各列标题 For i = 0 To SumFields - 1 searchList.Col = i

searchList.TextMatrix(0, i) = rs.Fields(i).Name searchList.ColAlignmentFixed(i) = 3 'searchList.BackColor = &H8000000F Next i

'设置第一行的各列标题文字格式 For i = 0 To SumFields - 1 searchList.Col = i

searchList.CellAlignment = 4 ' searchList.CellFontBold = True 'searchList.CellForeColor = vbBlue

j = TextWidth(rs.Fields(i).DefinedSize) * 8

'设置标题宽度,防止部分长文字不显示 If j > searchList.ColWidth(i) Then searchList.ColWidth(i) = j End If Next i

'循环开始--显示所有符合条件记录

rs.MoveLast

searchList.Rows = rs.RecordCount + 1 '其中标题占一行

rs.MoveFirst

searchList.Row = 0

While Not rs.EOF

第23 页

保定科技职业学院论文设计

searchList.Row = searchList.Row + 1 '增加一行,用于写入内容

For i = 0 To SumFields - 1 searchList.Col = i

If searchList.Col = 0 Then

searchList.CellBackColor = &H8000000F End If

searchList.CellAlignment = 4 '读入内容

If Not IsNull(rs.Fields(i).Value) Then searchList.Text = rs.Fields(i).Value Else

searchList.Text = \ End If Next i

rs.MoveNext Wend

'循环结束--显示所有符合条件记录 End Sub

Private Sub tblOperator_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Key Case \

Call Form3.setType(\ Form3.Show vbModal Case \

Call Form3.setType(\ Form3.Show vbModal

Case \ Unload Me

Case \ rec_user.Delete

第24 页