I am an experienced VB developer but an absolute PowerBasic newbie (I have only had FireFly installed for about 2 hours). I have a form with a rich text box that has more rows of text than are visible. The scrollbar is turned on and is displayed, but I can't get get the scrolling to work. I remember reading somewhere on the PB site that you had to set the value of a scrollbar control, so I assume the scroll on the rich text box also needs to be set in code, but I can't figure out how to do it for the scrollbar or the rich text box.
Any help would be appreciated.
Hi Sean,
Not really sure what your problem could be. The vertical scroll bar works fine in a RichEdit control without having to write any code. Make sure that you have the WS_VSCROLL and ES_MULTILINE windowstyles set.
Setting the value of scrollbars, etc is usually reserved for the standalone HSCROLL or VSCROLL scrollbars, not the scrollbars that you see embedded inide controls like the RichEdit, ListBox, ListView, etc...
I have everything setup properly--the glitch is that I am setting the contents in code, and it must be choking on something. If I comment the code that sets the contents, and then add text through the UI, it works fine.
Here is what I did:
1. I opened WordPad and created a document and saved it to my desktop
2. I opened the document in notepad
3. I copied the document contents into my FF3 procedure
4. I built-up a string like this: sText = sText & $CrLf & ""
5. I used FF_RichEdit_SetText to stuff sText into the RichText control
The control shows the rich text correctly, but it won't let me scroll, select, or move around with the cursor. I will keep working on it, but any examples of getting rich text into a RichText control with code would be appreciated.
Thanks to all,
Sean
Hi Sean,
I have attached a very simple project that loads an rtf file and displays it. No trouble selecting or scrolling the text. i wonder if the way that you are building the string in your code might have something to do with your problem? I can look at your project if you wish to email it to me.
Sean,
You might want to take a look at the SuperMessageBox example program. If uses the Richedit controls and demo's how to programatically build RTF formated strings that can be easily loaded into the RichEdit control. The link is:
http://www.planetsquires.com/protect/forum/index.php?topic=1950.0