C+Builder problems.
How do I write some text in a label, where after pushing Enter it will be saved into a file.
And the Question goes the other way around.
How can I read a file into a label.
tx for your help
C+Builder problems.
How do I write some text in a label, where after pushing Enter it will be saved into a file.
And the Question goes the other way around.
How can I read a file into a label.
tx for your help
!G!
You should use an edit box for any text that will change, if you dont want the text hand edited set it to read only. When using an Edit box look under methods at something like LoadFromFile or SaveToFile. Im not at home with my C++ Builder at the moment and I can't remember exactly what they are called but you'll know it when you find it.
If you really want to use a label, which I don't recommend for text that will change try using fstream to send the data to a file stream.
Why don't I recommend labels for text that will change at runtime???
Think about it, If you write in text at runtime that is longer than the space you've allowed for the text label it might scroll of the window or over/under other components. If you use an edit box this won't happen as the box will just scroll. Generally text boxes are used for static text and edit boxes for dynamic. There are occasions when using a text box is the best way to go, but you should avoid it if you can.
You could alternatively try the File I/O functions provided by MFC
tudehopet uses Borland Compiler 5.5
and Visual C++ 6.