Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - TaskDialog close
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

TaskDialog close

 Post Reply Post Reply
Author
Message
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 258
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post Topic: TaskDialog close
    Posted: 26 June 2008 at 7:20pm
Using the TaskDialog with VB6, WinXP

When I click on a hyperlink, the   _HyperlinkClicked event is triggered, but the dialog doesn't close.

How can I get it to close?

(It closes when a button is clicked).

Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
Back to Top
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post Posted: 26 June 2008 at 8:26pm
Try this:

taskDialog.ClickButton xtpTaskButtonCancel

The parameter is the ID of the button you want to simulate clicking so change this to whichever button gives the result you want.
Back to Top
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 258
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post Posted: 27 June 2008 at 5:44am
Thanks for the fast reply.
This works but only if I know the ID of a suitable button.

I am hoping for a general option that can be used in all cases.

I tried   .ClickButton  0

hoping that this would click the default or first button.  But this seems to do nothing for a while, andf then when I close the Dialog I get VB error message "Out of Stack Space".  So I stopped trying button zero <grin>



So as a workaround, is it possible to obtain the ID of a button from a Dialog that is already shown?
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
Back to Top
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post Posted: 27 June 2008 at 9:13pm
Try using the DefaultButton property.

Also, you can use the CommonButtons property to determine what standard buttons are available. This can be any combination of these buttons:
xtpTaskButtonOk OK Push Button.
xtpTaskButtonYes Yes Push Button.
xtpTaskButtonNo No Push Button.
xtpTaskButtonCancel Cancel Push Button.
xtpTaskButtonRetry Retry Push Button.
xtpTaskButtonClose Close Push Button.

It doesn't look like there's any way to retrieve the IDs of any existing custom buttons.
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.188 seconds.