Track Control-Visual Studio Just-In-Time Debugger |
Post Reply |
Author | |
wsun
Groupie Joined: 11 January 2012 Status: Offline Points: 22 |
Post Options
Thanks(0)
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.
|
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
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) |
|
wsun
Groupie Joined: 11 January 2012 Status: Offline Points: 22 |
Post Options
Thanks(0)
|
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. |
|
wsun
Groupie Joined: 11 January 2012 Status: Offline Points: 22 |
Post Options
Thanks(0)
|
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. 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.
|
|
Willowmaster
Senior Member Joined: 12 July 2010 Location: Netherlands Status: Offline Points: 180 |
Post Options
Thanks(0)
|
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 |
|
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 |