Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Track Control-Visual Studio Just-In-Time Debugger
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Track Control-Visual Studio Just-In-Time Debugger

 Post Reply Post Reply
Author
Message
wsun View Drop Down
Groupie
Groupie


Joined: 11 January 2012
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote wsun Quote  Post ReplyReply Direct Link To This Post Topic: Track Control-Visual Studio Just-In-Time Debugger
    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.
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
wsun View Drop Down
Groupie
Groupie


Joined: 11 January 2012
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote wsun Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
wsun View Drop Down
Groupie
Groupie


Joined: 11 January 2012
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote wsun Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Willowmaster View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 July 2010
Location: Netherlands
Status: Offline
Points: 180
Post Options Post Options   Thanks (0) Thanks(0)   Quote Willowmaster Quote  Post ReplyReply Direct Link To This Post 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



Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.154 seconds.