Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textbox controls in Dialog boxes

Status
Not open for further replies.

finitesimian

Programmer
Feb 11, 2006
29
US
I have three questions regarding the 'textbox' control in an attachmate dialog box:

1. Is there a way to limit the number of characters allowed in a textbox control? In Vb.net, I can do this by using either a maskedtextbox, or the 'textbox.Maxlength' property. I haven't found a way to do this in attachmate-basic.

2. Is there a way to limit the textbox control to numeric input? I can also do this in vb.net using the 'masked textbox'.

3. Is there a way to make the cursor automaticly tab to the next textbox/previous textbox if user uses the backspace (I already know how to set the tab order BTW).


Reason I need this (if it's possible) is because I'm attemtping to create a dialog box for phone numbers. Thanks in advance.
 
Looks like everyones waiting for a ray of hope here. I haven't found anyway of doing it (doesn't mean it can't be).

I have had limited success using the FileDlgFunction to check length and char type of input, but nothing like the Form controls of the VB family :(
Code:
Declare Function 
FileDlgFunction(identifier$, action, suppvalue)

Sub Main
  Dim identifier$
  Dim action as Integer
  Dim suppvalue as Integer
   
  Begin Dialog newdlg 184, 63, "EXAMPLE", .FileDlgFunction
    OkButton  130, 6, 50, 14
    CancelButton  130, 23, 50, 14
    TextBox  10, 25, 89, 14, .TextBox1
    Text  10, 10, 89, 10, "INPUT 7 DIGITS"
  End Dialog
   
  Dim mydialog as newdlg
   On Error Resume Next
   Dialog mydialog 
End Sub

Function FileDlgFunction(identifier$, action, suppvalue)
  Select Case action
    Case 1'initialize
      DlgFocus 2
    Case 2'button or value change
    Case 3'text or combo box changed      
      if len(DlgText(2)) > 7 then DlgText(2),left(DlgText(2),7)
    Case 4'control focus changed
    Case 5 'idle
  End Select
End Function
Biggest drawback to EB Dialog Boxes is there always has to be a user action to trigger the FileDlgFunction. In the example provided input 9 chars in the TextBox then Tab, should truncate back to 7. But as you can see it only happens when there is some action by the user. Tried same code "if len(DlgText(2)) > 7 then DlgText(2),left(DlgText(2),7)" in the idle (or case 5) but it also only truncates the value once the user tabs or moves the mouse. If you build an improvement please share.
 
As you are discovering, the dialog boxes in Extra are not very functional. Anytime I need to interact with the user I use VB or VBA, depending on the project and the necessary outputs.

Here's a link to some basics of having VB(A) run code that controls Extra.

How do I use VB(A) to manipulate attachmate (6.5+)? faq99-4069

calculus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top