Print Page | Close Window

[SOLVED] GroupBox breaking CausesValidation

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=19248
Printed Date: 21 May 2024 at 4:50am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] GroupBox breaking CausesValidation
Posted By: daveb600Codejock
Subject: [SOLVED] GroupBox breaking CausesValidation
Date Posted: 30 November 2011 at 11:07am
Hi,

I have an issue where my custom user control, when placed on a group box, does not apply its validate event correctly (i.e. cancel = True to stop focus move).  When the control is placed on a frame or on the form it validates correctly.

I'm using version 13.4.2 but have tried it on 15.0.2.

The issue only manifests itself when the control is on a GroupBox AND the button is a PushButton. If either or both are standard VB6 controls then there is no issue.

The event order when the frame is a VB6 frame and button is standard or codejock is 
TestControlFrame: UserControl_EnterFocus
TestControlFrame: txtData_GotFocus
TestControlFrame: txtData_Validate

But the event order when the frame is codejock and the button is standard or codejock is
TestControlGroupBox: UserControl_EnterFocus
TestControlGroupBox: txtData_GotFocus
TestControlGroupBox: txtData_LostFocus
TestControlGroupBox: UserControl_ExitFocus
TestControlGroupBox: txtData_Validate
TestControlGroupBox: UserControl_EnterFocus
TestControlGroupBox: txtData_GotFocus
The difference with this one however is that the codejock push button will execute the VB6 one will not.

I think that it is something to do with the CausesValidation property.  Its like the group box is killing it.

I cannot use the standard VB6 frame however as the codejock group box fixes an intermittent paint issue when clicking on a frame and custom controls disappearing.  I also cannot replace the buttons as they all have icons now.

I've attached a very simple example of this in action.  uploads/7217/ControlValidationIssue.zip - uploads/7217/ControlValidationIssue.zip
Note. Do not click between the user controls as this will get stuck in a validation loop.
Note. The user control and app must be compiled (and run using this) to correctly highlight the issue.

I've tried placing the button in a frame, groupBox and pictureBox but this had no effect. I also tried placing the usercontrol text box which does the validation in a frame, groupBox and pictureBox as well.

Has anyone got any ideas?  

This is for an app where a custom user control is used to force correct selection of data. We're starting to get lots of issues on our support desk where users have managed to enter invalid data because of this.  Its taken me three days to figure this out so I'd take any solution at the moment :o)  (Other than replace all the pushButtons / GroupBoxs)




Replies:
Posted By: Hemesh
Date Posted: 03 February 2012 at 5:55am
Comes back to a similar issue I had with the CommandBars and custom codejock controls being placed on there.. they didn't work, but standard vb6 ones did!

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

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0


Posted By: ABuenger
Date Posted: 05 February 2012 at 3:02am
Hi,

this has been fixed for the next release.

Andre



-------------
Codejock support



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