FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to set the default pushbutton
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
How to set the default pushbutton
Posted: Wed Jun 23, 2010 02: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
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: How to set the default pushbutton
Posted: Wed Jun 23, 2010 05: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
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: How to set the default pushbutton
Posted: Wed Jun 23, 2010 08: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: How to set the default pushbutton
Posted: Wed Jun 23, 2010 08:39 PM

Frank,

Have you tried:

@ 1,1 button ... DEFAULT

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: How to set the default pushbutton
Posted: Thu Jun 24, 2010 06:27 AM
James,

thank you, I've overlooked that :-) 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

Continue the discussion