Eddie_Green
asked on
Microsoft Ink Control
Hi
I have an (MS) InkPicture control on an MS Access 2010 form which, after saving the graphic I wish reset (clear).
I've successfully written the code in VBA to clear the control on the screen but when I try to use the control again, ie draw another graphic, the screen will not accept any strokes and when I revert to design mode, the original pen strokes are still in place
Any ideas? - Code attached
Many thanks
I have an (MS) InkPicture control on an MS Access 2010 form which, after saving the graphic I wish reset (clear).
I've successfully written the code in VBA to clear the control on the screen but when I try to use the control again, ie draw another graphic, the screen will not accept any strokes and when I revert to design mode, the original pen strokes are still in place
Any ideas? - Code attached
Many thanks
Dim objInk As MSINKAUTLib.InkPicture
Set objInk = Me.InkSignature.Object
objInk.Enabled = False
objInk.Ink.DeleteStrokes
objInk.Enabled = True
objInk.InkEnabled = True
ASKER
boaq2000
I did in fact get the VBA code from the Microsoft site, so it's strange that you feel it's only for .net
In the meantime, I found the only solution to be to close the form and re-open it again, which does in fact open a new (cleared) instance.
Thanks anyway
I did in fact get the VBA code from the Microsoft site, so it's strange that you feel it's only for .net
In the meantime, I found the only solution to be to close the form and re-open it again, which does in fact open a new (cleared) instance.
Thanks anyway
<so it's strange that you feel it's only for .net>
Again, I said "From what I know about this control"...
I have only seen info on this code in regard to .net technologies...
I mean if it was fully compatible, then why is it not working correctly in MS Access?
You don't have to close/reopen the form in .net...
Sorry I could not be more help.
JeffCoachman
Again, I said "From what I know about this control"...
I have only seen info on this code in regard to .net technologies...
I mean if it was fully compatible, then why is it not working correctly in MS Access?
You don't have to close/reopen the form in .net...
Sorry I could not be more help.
JeffCoachman
BTW, you can actually accept your own post as the solution here.
;-)
JeffCoachman
;-)
JeffCoachman
> VBA code from the Microsoft site
Please post the link. I have no experience with the Ink control, but if you have reference material, we might try to figure it out.
(°v°)
Please post the link. I have no experience with the Ink control, but if you have reference material, we might try to figure it out.
(°v°)
ASKER
My sincere apologies - having visited several sites in the past couple of days I did NOT get the source code from an MS link - it was something that another party had constructed - sorry.
Also boag2000, I did not mean to offend, I don't think I actually saw your comment "From what I know about this control" (too busy trying to find the solution!).
I'm fairly new to posting questions/comments on E-E so please bear with me - I've learnt the lesson today to be more attentive to people's answers and more careful with my replies.
Also boag2000, I did not mean to offend, I don't think I actually saw your comment "From what I know about this control" (too busy trying to find the solution!).
I'm fairly new to posting questions/comments on E-E so please bear with me - I've learnt the lesson today to be more attentive to people's answers and more careful with my replies.
ASKER
Going on ... having got the control on the form and "inked" it, when I use the following code
Dim objInk As MSINKAUTLib.InkPicture
Set objInk = Me.InkSignature.Object
objInk.Enabled = False
objInk.Ink.DeleteStrokes
objInk.Enabled = True
objInk.InkEnabled = True
in the attempt to delete the strokes and start again that control does clear but will not then allow more strokes to be added.
Dim objInk As MSINKAUTLib.InkPicture
Set objInk = Me.InkSignature.Object
objInk.Enabled = False
objInk.Ink.DeleteStrokes
objInk.Enabled = True
objInk.InkEnabled = True
in the attempt to delete the strokes and start again that control does clear but will not then allow more strokes to be added.
Jeff found some pages on MSN the other day:
http://msdn.microsoft.com/en-us/library/aa480678.aspx#tbconfffsecuresig_topic4
The figure has a [Reset] button, but I didn't find the relevant code portion. Too bad, as this seems to be what you need to do.
http://msdn.microsoft.com/en-us/library/ms698514.aspx
I see a Refresh method. Maybe the Ink strokes are only the saved metrics, and the control has another object containing the current display.
The problem is that there are many variants of this object, most of them for the TabletPC, and I don't know which pages are relevant. On one of them there is a Dispose method, but not on the other...
Where did you acquire the control, and did it come with documentation, or links to documentation pages?
(Again, I have no experience with this!)
(°v°)
http://msdn.microsoft.com/en-us/library/aa480678.aspx#tbconfffsecuresig_topic4
The figure has a [Reset] button, but I didn't find the relevant code portion. Too bad, as this seems to be what you need to do.
http://msdn.microsoft.com/en-us/library/ms698514.aspx
I see a Refresh method. Maybe the Ink strokes are only the saved metrics, and the control has another object containing the current display.
The problem is that there are many variants of this object, most of them for the TabletPC, and I don't know which pages are relevant. On one of them there is a Dispose method, but not on the other...
Where did you acquire the control, and did it come with documentation, or links to documentation pages?
(Again, I have no experience with this!)
(°v°)
ASKER
The control is an Active-X one, selectable from the Access (2010) extra controls drop-down, entitled "Microsoft Ink Picture Control". The only documentation I found was that of another user on the web, plus the "predictiveness" offered when coding in VBA.
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<For some reason, I thought that this control was only available on the TabletPC.>
And as I stated, the only references to this control I saw were regarding .net.
(Another reason why I try not to speak in absolutes...)
;-)
Jeff
And as I stated, the only references to this control I saw were regarding .net.
(Another reason why I try not to speak in absolutes...)
;-)
Jeff
ASKER
Many thanks indeed - all works as required
So it may not be fully compatible.
You may want to Google how this is done in .net for some additional insight