I am running XOJO 2017r1.1 and have a text area box that I fill with text which sometimes over fills the area I have set for it and when I do the vertical scroll bar appears so I can see all the text.
My problem is that I would like to know when this happens so I can make changes. (Like increasing the height of the text box and reducing the height of the text box below it.
Is there any way I can detect when the scrollbar is active?
Thanks for any help or Ideas you can give me for this problem.
Maybe in TextChange Event, check the TextArea contents Height and compare it to the TexTArea Height ?
I’m sorry I couldn’t find anything on how to activate the textchange and then get the TextArea contents Height. .
I think if I could find TextArea contents Height ( I could make it work. but I couldn’t find the code)
Sorry I didn’t get back sooner but I have been working on it and finally gave up and built a worked around based on the text length. It works but its not perfect by a long shot.
In the IDE, select the TextArea, then go to the Insert Menu, Add an Event, choose TextChange and you will see the Event.
To understand how that works, add Beep in the Event, run, click in the TextArea, press a key in the Keyboard and you will get a beep each time you press a key.
Since you add the TextArea in the window, you know its Width (in the Window Editor, select the TextArea and watch in the property pane - right of IDE - and note the TextArea Width). You can get that value using Me.Width (in the TextChanged event).
In TextChange, add code to get the whole TextEdit text Height. For that, get an eye in the Graphics Class / StringHeight.
You have to create an offscreen Picture (check the Picture Class), and use g.StringHeight (check in the Graphics Class the correct name/syntax) - remember to use the width parameter - to get the text height.
Then, you can compare that value to the TextArea Height and therefore know if a ScrollBar was displayed or not.
Now, this is an idea I do not tested. It may be good
And, reading my text above gives you hint of why you have to read the documentation.
Did you go there:
You can also download the Introduction Book from there:
I’m use to using the reference language guide to find my coding examples but nothing happens when I click on it (it still works in real basic) And I couldn’t find any help in the 2 links you gave me. I’m sure I’m not searching right or I’m doing something else wrong but I just can’t find the code I want.
I’m trying to load a text area box with a string. (Not clicking on the text box so I don’t think it will help me.)
Thanks for trying to help but I don’t think it will work and I can’t find the code to use.