I have a self-developed OCX with the following Properties:
Windowless = true
CanGetFocus = False
ClipControl Uses Region
Among others...
Because the control is NOT allowed to get focus, only a few intrinsic components are allowed. They are the label control and the image control. That's it, nothing else... the control is an on screen keyboard for touch screens, in case you're wondering.
Everything works fine, except I want this control to include the CAUSESVALIDATION property, so I can set it to FALSE!
No sweat... I'm about to add the get/let for that property, and the Validate event, just in case I change my mind and want to raise the event.
But hold on... it doesn't get focus, so it can't fire the validate event, right?!? WRONG, IT DOES FIRE THE VALIDATE EVENT! But can I stop it? Stay with me...
Within my validate event on some text boxes, I filter profanity (public computer you see). I wanted to use the validate event to also verify if a field is blank, which should be simple, right?
Well, every time the OCX is used (clicked), the text box that currently has focus, LOOSES FOCUS. It's not allowed to get focus, but the validate event fires anyway. Now I realize that the OCX doesn't actually RECEIVE focus (it can't), but the text boxes do LOOSE FOCUS... causing my need prevent the OCX from triggering the Validate event.
Who's still with me? Those of you who are might want to discuss this scenario...
So be thinking about it while I ignore the need for sleep and try to make it work. *Deep Breath In*...
Ok, post midnite logic could be flawed: Is it actually my OCX that is triggering the validate?
No Dolphins were harmed in the posting of this message... Dolphin Friendly Tuna!
Windowless = true
CanGetFocus = False
ClipControl Uses Region
Among others...
Because the control is NOT allowed to get focus, only a few intrinsic components are allowed. They are the label control and the image control. That's it, nothing else... the control is an on screen keyboard for touch screens, in case you're wondering.
Everything works fine, except I want this control to include the CAUSESVALIDATION property, so I can set it to FALSE!
But hold on... it doesn't get focus, so it can't fire the validate event, right?!? WRONG, IT DOES FIRE THE VALIDATE EVENT! But can I stop it? Stay with me...
Within my validate event on some text boxes, I filter profanity (public computer you see). I wanted to use the validate event to also verify if a field is blank, which should be simple, right?
Well, every time the OCX is used (clicked), the text box that currently has focus, LOOSES FOCUS. It's not allowed to get focus, but the validate event fires anyway. Now I realize that the OCX doesn't actually RECEIVE focus (it can't), but the text boxes do LOOSE FOCUS... causing my need prevent the OCX from triggering the Validate event.
Who's still with me? Those of you who are might want to discuss this scenario...
So be thinking about it while I ignore the need for sleep and try to make it work. *Deep Breath In*...
Ok, post midnite logic could be flawed: Is it actually my OCX that is triggering the validate?
![[fish] [fish] [fish]](/data/assets/smilies/fish.gif)