display text
-
Hi, I created a SDI project with a few dialogs One of the dialogs is to allow user to open up a file, then the program will parse the data. After that, it will display some text data to the user. I did some search on display text but I am sure what's the best approach. Can or should I use a CDialog to display text? The text is going to be a couple hundred lines and some lines are about 90 characters long. So, I probably need to have vertical & horizontal scroll bars. Any suggestions would be appreciated! Thanks, Kevin
-
Hi, I created a SDI project with a few dialogs One of the dialogs is to allow user to open up a file, then the program will parse the data. After that, it will display some text data to the user. I did some search on display text but I am sure what's the best approach. Can or should I use a CDialog to display text? The text is going to be a couple hundred lines and some lines are about 90 characters long. So, I probably need to have vertical & horizontal scroll bars. Any suggestions would be appreciated! Thanks, Kevin
An edit control in a dialog would do nicely. You can enable several styles that help: "multiline", "want return", and "horizontal scroll" and "vertical scroll". You can set these in the resource editor when you create the control. If the text is formatted using spaces (say, into columns), you may want to set the font used in the edit control to a monospaced font (Courier New, for example).
Software Zen:
delete this;
-
Hi, I created a SDI project with a few dialogs One of the dialogs is to allow user to open up a file, then the program will parse the data. After that, it will display some text data to the user. I did some search on display text but I am sure what's the best approach. Can or should I use a CDialog to display text? The text is going to be a couple hundred lines and some lines are about 90 characters long. So, I probably need to have vertical & horizontal scroll bars. Any suggestions would be appreciated! Thanks, Kevin
kevincwong wrote:
Can or should I use a CDialog to display text?
Why would you use a CDialog to display text? What exactly do you mean by this? To Display text, a nice idea is to use CEditBox, incase you may want to allow the user to transport this data somewhere else i.e. He may copy this and paste somewhere else. Can you elaborate the problem a little more? You have an apple and me too. We exchange those and have one apple each. You have an idea and me too. We exchange those and have two ideas each. - someone
-
kevincwong wrote:
Can or should I use a CDialog to display text?
Why would you use a CDialog to display text? What exactly do you mean by this? To Display text, a nice idea is to use CEditBox, incase you may want to allow the user to transport this data somewhere else i.e. He may copy this and paste somewhere else. Can you elaborate the problem a little more? You have an apple and me too. We exchange those and have one apple each. You have an idea and me too. We exchange those and have two ideas each. - someone
You are correct. After doing more research, I found that the CEditBox can do exactly what I wanted. I am from Unix side. So, please forgive me if my MFC lingos or knowledge are not good enough. Currently, I am working on a MFC project to do something like inventory control. I already done all backend sql search stuff. Now, I need to display the inventory information to the user in text format. For example: Item 1: something something Quantity: 20 Description: some description......... Item 2: someting else Quantity: 202 Description: some other description......... So, as I mentioned before, the CEditBox works perfectly for me. Regards, KEvin