结账之SSTab

结账之SSTab,第1张

概述     刚打开结账窗体,就看到一个既陌生又亲切的控件---SSTab,记得在敲VB百例的时候,用过这个控件,今天看到它的时候一点都想不起来它叫什么来着,通过翻阅师姐的博客,才知道原来它就叫做SStab,是部件中的一个控件。 加载: 工程→部件→控件 中勾选“Microsoft Tabbed Dialog Control”控件,点击应用 介绍:SSTab控件提供了一组选项卡,每个都充当一个容器,包

刚打开结账窗体,就看到一个既陌生又亲切的控件---sstab,记得在敲VB百例的时候,用过这个控件,今天看到它的时候一点都想不起来它叫什么来着,通过翻阅师姐的博客,才知道原来它就叫做sstab,是部件中的一个控件。


加载工程→部件→控件 中勾选“Microsoft Tabbed Dialog Control”控件,点击应用

介绍sstab控件提供了一组选项卡,每个都充当一个容器,包含了其他的控件。控件中每次只有一个选项卡是活动的,给用户提供了其所包含的控件,而其他选项卡都是隐藏的。


用法:

Private Sub sstab1_Click(PrevIoUsTab As Integer)

@H_403_60@Dim sum As Long,sum1 As Long,sum2 As LongDim i As Long<span >'选择sstab的各个选项卡</span><strong>Select Case sstab1.Tab Case 0 <span >'购卡</span></strong> <span >'从数据库中选择对应用户的内容</span> txtsql1 = "select * from student_info where userID='" & Trim(combouserID.Text) & "'" Set mrc1 = Executesql(txtsql1,Msgtext) With myflexgrID1 .Rows = 1 .TextMatrix(0,0) = "学号" .TextMatrix(0,1) = "卡号" .TextMatrix(0,2) = "日期" .TextMatrix(0,3) = "时间" .TextMatrix(0,4) = "金额" do while Not mrc1.EOF .Rows = .Rows + 1 .CellAlignment = 4 .TextMatrix(.Rows - 1,0) = mrc1.FIElds(1) .TextMatrix(.Rows - 1,1) = mrc1.FIElds(0) .TextMatrix(.Rows - 1,2) = mrc1.FIElds(12) .TextMatrix(.Rows - 1,3) = mrc1.FIElds(13) .TextMatrix(.Rows - 1,4) = mrc1.FIElds(7) mrc1.MoveNext Call AdjustColWIDth(frmcheckoutaccount,myflexgrID1) <span >'自定调节myflexgrID的列宽</span> Loop End With <strong>Case 1 <span >'充值</span></strong> txtsql2 = "select * from recharge_info where userID='" & Trim(combouserID.Text) & "'" Set mrc2 = Executesql(txtsql2,Msgtext) With myflexgrID2 .Rows = 1 .TextMatrix(0,2) = "充值金额" .TextMatrix(0,3) = "日期" .TextMatrix(0,4) = "时间" do while Not mrc2.EOF .Rows = .Rows + 1 .CellAlignment = 4 .TextMatrix(.Rows - 1,0) = mrc2.FIElds(1) .TextMatrix(.Rows - 1,1) = mrc2.FIElds(2) .TextMatrix(.Rows - 1,2) = mrc2.FIElds(3) .TextMatrix(.Rows - 1,3) = mrc2.FIElds(4) .TextMatrix(.Rows - 1,4) = mrc2.FIElds(5) mrc2.MoveNext Call AdjustColWIDth(frmcheckoutaccount,myflexgrID2) <span > '自定调节myflexgrID的列宽</span> Loop End With <strong> Case 2 <span > '退卡</span></strong> txtsql3 = "select * from cancelcard_info where userID='" & Trim(combouserID.Text) & "'" Set mrc3 = Executesql(txtsql3,Msgtext) With myflexgrID3 .Rows = 1 .TextMatrix(0,4) = "退卡金额" do while Not mrc3.EOF .Rows = .Rows + 1 .CellAlignment = 4 .TextMatrix(.Rows - 1,0) = mrc3.FIElds(0) .TextMatrix(.Rows - 1,1) = mrc3.FIElds(1) .TextMatrix(.Rows - 1,2) = mrc3.FIElds(3) .TextMatrix(.Rows - 1,3) = mrc3.FIElds(4) .TextMatrix(.Rows - 1,4) = mrc3.FIElds(2) mrc3.MoveNext Call AdjustColWIDth(frmcheckoutaccount,myflexgrID3) <span >'自定调节myflexgrID的列宽</span> Loop End With <strong> Case 3 <span >'临时用户</span></strong> txtsql4 = "select * from student_info where userID='" & Trim(combouserID.Text) & "' and type='临时用户'" Set mrc4 = Executesql(txtsql4,Msgtext) With myflexgrID4 .Rows = 1 .TextMatrix(0,4) = "金额" do while Not mrc4.EOF .Rows = .Rows + 1 .CellAlignment = 4 .TextMatrix(.Rows - 1,0) = mrc4.FIElds(1) .TextMatrix(.Rows - 1,1) = mrc4.FIElds(0) .TextMatrix(.Rows - 1,2) = mrc4.FIElds(12) .TextMatrix(.Rows - 1,3) = mrc4.FIElds(13) .TextMatrix(.Rows - 1,4) = mrc4.FIElds(7) mrc4.MoveNext Call AdjustColWIDth(frmcheckoutaccount,myflexgrID4) <span >'自定调节myflexgrID的列宽</span> Loop End With <strong> Case 4 <span ><span > '汇总</span></span></strong> txtsellcardcount.Text = myflexgrID1.Rows - 1 <span ><span > '售卡数</span></span> txtcancelcardcount.Text = myflexgrID3.Rows - 1 <span > '退卡数</span> txtallsellcard.Text = Val(txtsellcardcount.Text) - Val(txtcancelcardcount.Text) <span > '总售卡数</span> <span >'充值金额</span> For i = 1 To myflexgrID2.Rows - 1 sum = sum + Val(myflexgrID2.TextMatrix(i,2)) Next txtpay.Text = sum <span > '退卡金额</span> For i = 1 To myflexgrID3.Rows - 1 sum1 = sum1 + Val(myflexgrID3.TextMatrix(i,4)) Next txtcancelcardpay.Text = sum1 <span >'临时收取金额</span> For i = 1 To myflexgrID4.Rows - 1 sum2 = sum2 + Val(myflexgrID4.TextMatrix(i,4)) Next txtlspay.Text = sum2 txtcountpay.Text = sum - sum1 <strong>Case 5 </strong><span >'退出</span> Unload Me<strong>End SelectEnd Sub</strong>
总结:当遇到一个陌生的事物时,就要慢慢去摸索、探究,在我们的不断努力下,它们就会甘拜下风,为我们所用,学习是这样,生活亦是这样,加油! 总结

以上是内存溢出为你收集整理的结账之SSTab全部内容,希望文章能够帮你解决结账之SSTab所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1269212.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存