Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Activating the Calculator and SET CONFIRM
Message
From
25/01/2002 03:52:43
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
24/01/2002 13:50:45
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00609788
Message ID:
00610328
Views:
21
>I am using a texbox that has a numeric value. In the keypressed event, I activate the calculator when the F4 button is pressed, or right-click. Unfortunately, the rest of the event continues immediately. I tried using
>Do while wexist('calculator')
>ENDDO
>but the system hangs up. Is there anyway to activate the calculator like a forms WindowType=MODAL, or any other way do do this so I can capture the result properly?
>Joel

Joel,
You might :
*Textbox.keypress
Lparameters nKeyCode, nShiftAltCtrl
If nKeyCode = -3
  _Calcvalue = this.Value
  oCalc = NewObject('CalcForm', 'calculatorform.prg')
  oCalc.show
  This.Value = _CalcValue
Endif

*calculatorform.prg
Define class CalcForm as Form
  WindowType = 1
  TitleBar=0
  BorderStyle=0
  Procedure activate
  With this
    If empty(.tag)
      Activate window 'calculator' in window (wontop())
      Move window ('calculator') to 0,0
      .width=wcols('calculator')*fontmetric(6)+sysmetric(3)*2
      .height=wrows('calculator')*fontmetric(1)+sysmetric(4)*2
      .tag='dummy'
    Else
      .release
    Endif
  Endwith
Endproc
Enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform