Results 1 to 3 of 3

Thread: [Answers] Textbox

Threaded View

  1. #1
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135

    [Answers] Textbox

    Q:
    textbox, uppercase
    A:
    recommended method is to do it as the data is entered using the @! input mask.

    Validation won't change the data that is entered, it simply validates the input.
    Default will not change the data either, it simply sets a default value when adding a new record.
    If you really did not want to use input masks you could use the Before Data Create and Before Data Update section delegates to change the data when updated
    You can't combine @ picture functions.



    Q:
    Dragging a numeric field onto a form produces a different field to dragging a numeric field onto a Canvas. The Canvas is a spinner. I don't want a spinner - how can I change it from a spinner?
    A:
    If you look under the advanced canvas controls there is a Numeric TexBox, you can use that and set the Data source if you don't want a spinner.



    You can actually use the 'returntabs' property on a textbox so that a return key is treated as a tab:
    Code:
    mytextbox.returntabs = 1
    This in turn will fire the valid and lostfocus events, so you could program either of those as required.



    Q:
    I would like the textbox to react like a label but displayed as a textbox, maybe with different forecolor and backcolor.
    A user should not be able to click into or to jumb by tab to the textbox, the text should not be selectable.
    That is what happens, when I set the Property ENABLED to .F. in VFP.
    A:
    You can set the enabled property for the textbox, for example in the Enabled When delegate:

    Code:
    ////////////////////////////////////////////////////////////////
    // Event delegate for 'enabledwhen' event
    proc page1_section1_field98_enabledwhen()
            this.enabled = .f.
    // or Lianja.get("field98").enabled = .f.
    endproc
    By default, the disabled field will be greyed out.



    Q:
    I want to bound a textbox to a variable
    A:
    It seems to need a refresh(). The following works:

    Code:
    define class xtextbox as textbox
            top = 0
            left = 0
            height = 20
            width = 200
            controlsource = "m.foo"
            name = "xtextbox"
    enddefine
    
    define class xform as form
            add object xtextbox1 as xtextbox
            name = "xform"
    enddefine
    
    private foo
    m.foo = "This is a Test"
    
    loForm = CreateObject("xform")
    loform.xtextbox1.refresh()
    loForm.Show(1)


    If you look at the field attributes you can adjust the font of the "Data" to be "Small", "Large", "Largest".
    You cannot make huge text boxes but you can do so with Labels.




    ​All topics in [Answers] alphabetically:http://www.lianja.com/community/show...ll=1#post12352
    Last edited by josipradnik; 2017-01-31 at 06:24.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us