![]()  | 
 
TaskDialog cancel button | 
 
    Post Reply  
   | 
  
| Author | |
   
   ElvisM  
   
   Senior Member  
   Joined: 12 October 2006 Location: Venezuela Status: Offline Points: 129  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: TaskDialog cancel buttonPosted: 08 February 2009 at 8:28pm  | 
 
| 
   
    
   Hi friends.
 
   
  Is there a way to set the taskdialog's cancel button property? 
I mean, I can set the default button, but I can't set the cancel button. 
I have a task dialog with 3 buttons. If the user presses the Esc key, the second button fires. I need that when the user presses the Esc key, the third button fires, not second. 
Regards, 
Elvis 
    | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 17.2 
   
  Platform: Windows 10 64bits Language: Visual Basic 2015  | 
 |
![]()  | 
 |
   
   jpbro  
   
   Senior Member  
   Joined: 12 January 2007 Status: Offline Points: 1357  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 08 February 2009 at 11:16pm | 
 
| 
   
    
   
I'm using 12.1.1, and pressing the ESC key doesn't click any button unless that button has a ID of 2. But the strange thing is, the ShowDialog and ButtonClick events return an ID of 8 for the clicked button (even if no button has an ID of 8). Can anyone else confirm this strange behaviour? I assume it is a bug. 
   
  This means you would have to have some unusual code to get the third button to be a cancel button: 
  | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 16.2.6 
   
  Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6  | 
 |
![]()  | 
 |
   
   jpbro  
   
   Senior Member  
   Joined: 12 January 2007 Status: Offline Points: 1357  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 13 February 2009 at 12:22pm | 
 
| 
   
    
   Hi Oleg,  
   
  Any idea why the TaskDialog returns 8 when you click a custom button with an ID of 2?  | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 16.2.6 
   
  Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6  | 
 |
![]()  | 
 |
   
   chrisABC  
   
   Senior Member  
   Joined: 05 June 2008 Status: Offline Points: 258  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 19 February 2009 at 11:04am | 
 
| 
   
    
   Playing with the Vista TaskDialog sample I find that 
   
  If you have a standard CANCEL button enabled, clicking CANCEL produces buttonclick event with ID = 8. Pressing the ESC key produces buttonclick event with ID = 8 If I add my own Custom Button with caption = &MyButton and ID = 11 then pressing ALT+M produces buttonclick event with ID = 11. My guess is that the ESC keypress is hardwired to the inbuilt Cancel Button event. With that in mind you can program around this if you need to (as you have done). I wouldn't call it a bug -- just a feature of the TaskDialog. But it would have been useful if this was mentioned in the documentation.  | 
 |
| 
   
     
     Chris (Manchester, UK) -- www.abc6.co.uk  ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
     
   
   | 
 |
![]()  | 
 |
    Post Reply  
   | 
  |
|       
  
  Tweet   	
    | 
 
| Forum Jump | Forum Permissions  ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum  |