Need scroll bars in Dialog Edit object

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
obfusc88
Pro Scripter
Posts: 89
Joined: Wed Mar 14, 2007 6:22 pm

Need scroll bars in Dialog Edit object

Post by obfusc88 » Wed May 23, 2012 9:02 pm

I have been checking the properties for the Edit object, but cannot seem to get scroll bars. I have a 100+ line file in the Text box, and want to be able to scroll through the content. The object has been set to ReadOnly, I can place the mouse cursor in the field and use the right arrow to scroll across like a single line marquee, but really need a vertical scroll bar (may need horizontal also). Here are the properties visible in code.

Code: Select all

object dMessage: TEdit
    Left = 32
    Top = 16
    Width = 369
    Height = 120
    Cursor = -1
    AutoSelect = False
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Comic Sans MS'
    Font.Style = []
    ParentFont = False
    ReadOnly = True
    TabOrder = 0
    Text = 'No new information available at this time.'
  end
In addition to these, AutoSize is set to True. And although I set the height to 120 to try to get more space, it still only shows the height of one line.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed May 23, 2012 9:29 pm

You need to use a Memo object vs. an Edit Object. The Memo object has properties for ScrollBars that you can select from. Use "ssBoth". You may want to set it to ReadOnly also to prevent any accidental changes while scrolling.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

obfusc88
Pro Scripter
Posts: 89
Joined: Wed Mar 14, 2007 6:22 pm

Post by obfusc88 » Thu May 24, 2012 2:27 am

Thanks Bob. That worked much better. But now sometimes I have scroll bars with a short message. How can I stop that?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu May 24, 2012 3:04 am

Check the length of the Text in the memo box.

If length is less than x then
SetObjectProperty,dialog,memo,scrollbars,ssNone
else
SetObjectProperty,dialog,memo,scrollbars,ssBoth

(no Macro Scheduler here now, so check planning syntax, it is dirty and from memory,so it is not good, but you should be able to get it right I hope)
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts