Virtual mode + msgbox = empty ? |
Post Reply |
Author | |
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
Posted: 27 June 2009 at 6:08pm |
Hello.
When i use the virtual mode and show a msgbox the report control become empty ! When i close the msgbox the report data is back... Is this "normal" ? You can try with the sample.. |
|
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate Language: VB6 SP6 (FR) |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
Yes, it's normal.
In virtualmode you have only one record, right? You only added one record and assigned value to wndReportControl.SetVirtualMode 100. Basicly you are telling the RC you want to have events for 100 rows (0 to 99) in BeforeDrawRow event. So everytime the RC needs to be redrawn, you will get events of BeforeDrawRow event for every single item that is in RC (only for visible rows and cols in RC) Now, if a VB messagebox appears the program stops executing the BeforeDrawRow events (also "normal" behaviour, you are waiting for an action of the user, user presses OK or Cancel the code after msgbox will be executed) and clears all drawn items just before msgbox appears (this is a guess, if you really want to know ask CJ developer) Msgbox is closed and program will execute BeforeDrawRow events again (for every single (visible) item in RC) and voila you're RC has been filled with data again.
CJ can't do anything about it but CJ can help you getting around this. Use the CJ TaskDialog instead of a VB MsgBox and BeforeDrawRow events keep firing
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
|
Dear Aaron,
The 'Normal' attribute of the problem seems a little strange anyway right ? When you tell me that a msgbox erases the contents of the report, i can understand (technically) but this need a big "WARNING" in the online help about the "Virtual Mode" ... No? If there is really no solution I will have to pass my way back to my old component that uses a similar method without this kind of problem ... I'm so sad ! But thank you for this fast and complete reply ! I'll send a post about a but of "virtual mode" and selectedrows tomorrow... Need to make a sample and a video to explain.
|
|
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate Language: VB6 SP6 (FR) |
|
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
|
|
|
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate Language: VB6 SP6 (FR) |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Absolutely not. See snapshot - 10000 records in virtual mode report. About is Message Box - right?
|
|
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
|
Hello,
No sorry, it's a modal form, not a msgbox (the function in VB6).
When i show a modal form, it's ok, a msgbox, not.
The solution provided by Aaron works (TaskDialog) but it's not perfect. My users are disturbed by the taskdialog look for simple msgbox.
|
|
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate Language: VB6 SP6 (FR) |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
It was MFC app and now - VB App with usual MsgBox call (without TOPMOST style like Task Manager used sometimes)
|
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
If you wrap the API MessageBox function to take the same parameters as the VB6 MsgBox, then it seems to work:
Just call RcMsgBox the way you would call MsgBox (minus the help file and context parameters. If you need those, then you will need to implement them yourself). |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
see http://forum.codejock.com/forum_posts.asp?TID=14660&PID=50612#50612 with standard VB MsgBox
|
|
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
|
The next version of the Report Control allow you to show std msgbox without being empty BUT it don't seems to works if the msgbox is shown by menu or on event associated with the form (checked by me with form_unload). It works if you show msgbox on button click (verified by the Mark sample). I'll try the API way. Thanks for the tip. :-) |
|
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate Language: VB6 SP6 (FR) |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Don't be naive - there is nothing in new version of Report Control related to MsgBox behaviour - belive me...
|
|
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
|
Ok... I'm so naive... So, there's no change in the new version of the report control about the msgbox. The report control wasn't and isn't able to manage msgbox correctly, except if you show the msgbox by clicking a button.
Yes, it's better like this.
|
|
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate Language: VB6 SP6 (FR) |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
I repeat - the problem is not in MsgBox - in VB Menu handling
try this function
Private Sub wndReportControl_SelectionChanged()
Dim i As Long i = Me.wndReportControl.SelectedRows.Count If i = 10 Then MsgBox "SelectedRows.Count " & i End Sub and you will see picture:
|
|
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
|
And i repeat, there's also many others case in wich the report is cleared !
Not only by menu.
On the "form_queryunload" event, add a msgbox and you'll see the report is cleared !
|
|
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate Language: VB6 SP6 (FR) |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
At least you see the case when app call MsgBox itself by situation reached - no buttons and no user action involved but view is OK?! Btw - did you try same situation in more recent development tools - like VC# or VB.NET?
|
|
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
|
No sorry. That's why I use ActiveX versions.
|
|
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate Language: VB6 SP6 (FR) |
|
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
|
Hi Mark,
I've found a "solution" for this problem !
Seems that if you set the focus to an other control (not the report control) the msgbox is shown without problem !
That's the reason why you don't have the problem with button's showing msgbox, the button got the focus before calling the msgbox !
Check my sample :
I've just added a simple textbox on the bottom of the screen.
Run the sample and (without doing anything else), go to menu "Report Control" / "Count selected".
You'll see 2 msgbox :
Don't know why but this may help you ?
|
|
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate Language: VB6 SP6 (FR) |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
No clear - when MsgBox called inside code (on Selection Change) it does not change focus before MsgBox popuped and don't use some other UI elements
|
|
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
|
Sorry i don't understand what you mean ?
|
|
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate Language: VB6 SP6 (FR) |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
See my prev snapshot with piece of code used to call MsgBox
|
|
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
|
Yes, i've seen but i also confirm that if i set the focus to other control before showing msgbox the problem disappear !
Don't know why but may be this could help you to find a solution ?
|
|
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate Language: VB6 SP6 (FR) |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Private Sub wndReportControl_SelectionChanged() If (wndReportControl.SelectedRows.Count = 10) Then
a = 0 For Each Row In wndReportControl.SelectedRows 'Debug.Print "Selected: " & Row.Index a = a + 1 Next MsgBox a 'MsgBox wndReportControl.SelectedRows.Count End If End Sub
Snapshot show that MsgBox popup before redraw happened on my last selection action - count already 10 but highlighted only prev selection
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |