How to set the default pushbutton

How to set the default pushbutton

Postby frose » Wed Jun 23, 2010 2:52 pm

Hi,

how to set the default pushbutton (DEFPUSHBUTTON) triggered by VK_RETURN in a dialog NOT defined from resource?
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
User avatar
frose
 
Posts: 392
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Rietberg

Re: How to set the default pushbutton

Postby Bayron » Wed Jun 23, 2010 5:59 pm

Hi frose,

I am not sure that we are talking about the same thing, but I set the focus to any control that I want, like this

ACTIVATE WINDOW oWin ON INIT oControl:SetFocus() /// In your case oPushButton:SetFocus()
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: How to set the default pushbutton

Postby frose » Wed Jun 23, 2010 8:32 pm

Hi Bayron,

thank you for your tip.

I mean the "default pushbutton" (usually OK) in the dialog which is normally triggered by the RETURN-key.
In the Resource Builder (Resource Workshop) you can set BS_DEFPUSHBUTTON.
But how to, if the dialog is NOT defined from resource?
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
User avatar
frose
 
Posts: 392
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Rietberg

Re: How to set the default pushbutton

Postby James Bott » Wed Jun 23, 2010 8:39 pm

Frank,

Have you tried:

@ 1,1 button ... DEFAULT

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: How to set the default pushbutton

Postby frose » Thu Jun 24, 2010 6:27 am

James,

thank you, I've overlooked that :oops: in the guide:
DEFAULT For default PushButtons: Automatically executes when the user press Enter, even from other controls. Use this clause only when building the Button from source code. When using resources, this clause must be specifies from the resource editor.
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
User avatar
frose
 
Posts: 392
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Rietberg


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: cmsoft and 85 guests

cron