本文介绍了DoEvents不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 您好, 有人可以给我一个提示,为什么我的CancelPrint Logic不能工作,尽管 DoEvents? in form lvele declaration我有 公共共享CancelPrint As Boolean ''打印逻辑 请执行rsAccount.EOF = False和CancelPrint = False Application.DoEvents() SelFormula =" {Socios.NumSocio} in" &安培; Chr(34)& rsAccount.Fields(" NumSocio")。Value& Chr(34)& "到 &安培; Chr(34)& rsAccount.Fields(" NumSocio")。Value& Chr(34) Dim crptStatement As new crptStatements_ATH 如果ChkNotificacion.CheckState = CheckState.Unchecked那么 crptStatement.Section7.SectionFormat.EnableSuppres s = True Else crptStatement.Section7.SectionFormat.EnableSuppres s = False 结束如果 crptStatement.RecordSelectionFormula = SelFormula i = i + 1 ProgressBar1.Value = i crptStatement.PrintToPrinter(1,False,0,0) rsAccount.MoveNext() 循环 如果取消打印则 MsgBox(打印由用户取消 ;,MsgBoxStyle.Exclamation) 结束如果 Private Sub CmdCancel_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)句柄 ''这会收集CancelPrint标志 CmdCancel.Click CancelPrint = True 结束子Hello,Could someone give me a hint why my CancelPrint Logic won''t work despite theDoEvents ?in form lvele declaration I havePublic Shared CancelPrint As Boolean''Printing LogicDo While rsAccount.EOF = False And CancelPrint = FalseApplication.DoEvents()SelFormula = "{Socios.NumSocio} in " & Chr(34) &rsAccount.Fields("NumSocio").Value & Chr(34) & " to " & Chr(34) &rsAccount.Fields("NumSocio").Value & Chr(34)Dim crptStatement As New crptStatements_ATHIf ChkNotificacion.CheckState = CheckState.Unchecked ThencrptStatement.Section7.SectionFormat.EnableSuppres s = TrueElsecrptStatement.Section7.SectionFormat.EnableSuppres s = FalseEnd IfcrptStatement.RecordSelectionFormula = SelFormulai = i + 1ProgressBar1.Value = icrptStatement.PrintToPrinter(1, False, 0, 0)rsAccount.MoveNext()LoopIf CancelPrint ThenMsgBox("Printing Canceled By User", MsgBoxStyle.Exclamation)End IfPrivate Sub CmdCancel_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles''This togles the CancelPrint flagCmdCancel.ClickCancelPrint = TrueEnd Sub推荐答案 为什么''CancelPrint''共享? - Herfried K. Wagner [MVP] < URL:http://dotnet.mvps.org/>Why is ''CancelPrint'' shared?--Herfried K. Wagner [MVP]<URL:http://dotnet.mvps.org/> 为什么''CancelPrint''被分享? - Herfried K. Wagner [MVP] < URL:http://dotnet.mvps.org/> Why is ''CancelPrint'' shared? -- Herfried K. Wagner [MVP] <URL:http://dotnet.mvps.org/> 这篇关于DoEvents不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-28 07:05