Print Page | Close Window

Track Control-Visual Studio Just-In-Time Debugger

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=19847
Printed Date: 27 November 2024 at 8:50am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Track Control-Visual Studio Just-In-Time Debugger
Posted By: wsun
Subject: Track Control-Visual Studio Just-In-Time Debugger
Date Posted: 11 June 2012 at 5:16am
Hi,



Can anyone help me to solve my problem. In then TrackControl_TimeLineLabel event, I tried to show a message box to confirm save the changed block after the block move from Row5 to Row6. 
The message box seems like the screenshot1 show as below. After save, I have to clear the Track Control and loop the new data into Track Control. But No matter I click on Yes/No button, it will popup Visual Studio Just-In-Time Debugger (screenshot2) and close the program.

Screenshot1


Screenshot2

Besides, in the TrackControl_BlockChanged event, I also tried to show a message box to confirm save the changed block after the block move from Row5 to Row6. The message box seems like the screenshot1. After save, I have to clear the Track Control and loop the new data into Track Control. But No matter I click on Yes/No button, it will automatic close the program.

I hope that can get your help as soon as possible. Thank you.



Replies:
Posted By: Xander75
Date Posted: 13 June 2012 at 3:36am
Hi,

Don't put the MessageBox in the TimeLineLabel simply because this event is always running in the background and that's why your application will crash!

What I have done is to create a BlockMoved & BlockOriginal global variable.

In the MouseDown event set the BlockOriginal to be the Block that is selected.
In the BlockChanged event set the BlockMoved to be the Block that is changing.

Then on MouseUp if the BlockMoved & BlockOriginal are different then show your MessageBox.




-------------
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)


Posted By: wsun
Date Posted: 15 June 2012 at 10:18pm
Hi,

Sorry, I can't get it. Can you show source sample here? I have some questions.
1. Do you means that Public BlockMoved & BlockOriginal as TrackBlock? 
2. To avoid it fire the MouseUp event, I have to set the .AllowBlockMove=False. But, I don't sure with the MouseDown event because it will fire the MouseDown event when left click even I have to set the .AllowBlockMove=False. Can you give me some advise to avoid it fire the MouseDown event.
3. In the MouseDown event, how to set the BlockOriginal  to be the Block that is selected? And also with the same case in the BlockChanged event.
4. At the beginning, I set .AllowBlockMove=True to allow the block move, after block moved I set .AllowBlockMove=False in the BlockChanged event. The message box doesn't show immediately after the block moved, after click again on the moved block the message box only show out.
5. Besides, I tried to use TrackControl.SelectedBlocks to set only the selected block can move and others are can't move to avoid the block overlap with each other. But I fail to do it. Can I get your advise how to set it?


Thank you.



Posted By: wsun
Date Posted: 17 August 2012 at 9:55pm
Hi,

I hope that this post will approved by moderator as soon as possible.
I have tried to do my project by following the suggestion from Xander75, but still fail to do this. Unhappy

My sample code show as below:

Public BlockMoved, BlockOriginal  As TrackBlock

Private Sub TrackControl1_MouseDown(Button As Integer, Shift As Integer, x As Long, y As Long)
Set BlockOriginal = TrackControl1.HitTest(x, y).Block
End Sub

Private Sub TrackControl1_BlockChanged(ByVal Block As XtremeReportControl.TrackBlock)
TrackControl1.AllowBlockMove = False
Set BlockMoved = Block
End Sub

Private Sub TrackControl1_MouseUp(Button As Integer, Shift As Integer, x As Long, y As Long)
If BlockMoved <> BlockOriginal Then 
' MsgBox "Confirm to Save ?" 
End If
End Sub


At the beginning, I have to set .AllowBlockMove = True. When run the program, it don't run the MouseDown event when left click on the block. Hence, I cannot get the value for BlockOriginal. To run the MouseUp event, I have to set .AllowBlockMove = False in BlockChanged event. But it only will run MouseUp event when clicking again on that changed block. When run the MouseUp event, it got error message "Object doesn't support this property or method". 
I hope that can get your advise and help from all of you as soon as possible.


Thank you in advance.


Posted By: Willowmaster
Date Posted: 21 August 2012 at 3:30am
BlockMoved is declared as a Variant. Try declaring it as TrackBlock. In the Mousup event do a compare with IS instead of <>.

-------------
Product: Xtreme SuitePro (ActiveX) version 15.3.1

Platform: Windows XP (32bit) - SP 3 (on VMWare)

Language: Visual Basic 6.0






Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net