| |

VerySource

 Forgot password?
 Register
Search
View: 1060|Reply: 6

How to display the content of a document at a specified location in a label, online etc.!

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-25 10:20:01
| Show all posts |Read mode
Write in Form's Oncreate
Label1-> Caption. It won't happen in the back ... I can't find it, use it urgently, please brothers !!!
Reply

Use magic Report

0

Threads

45

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-2-13 15:15:01
| Show all posts
I do not really understand your meaning
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-2-14 18:00:02
| Show all posts
It is a very simple question. There is a label control. I hope the content displayed above is a fixed text file, such as "D:\\1.txt". I don't know how to write a specific program. Help! Thank you!
As soon as you open the window, the label will display the content of that file, that's it ~
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-15 17:00:02
| Show all posts
Hehe, join directly in Oncreate:
Label1-> Caption = "D:\\1.txt";
Just fine
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-16 09:45:02
| Show all posts
// ------------------------------------------------ ---------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
// ------------------------------------------------ ---------------------------
#pragma package (smart_init)
#pragma resource "* .dfm"
TForm1 * Form1;
// ------------------------------------------------ ---------------------------
__fastcall TForm1 :: TForm1 (TComponent * Owner)
        : TForm (Owner)
{
}
// ------------------------------------------------ ---------------------------

void __fastcall TForm1 :: Button1Click (TObject * Sender)
{
   if (OpenDialog1-> Execute ())
   Edit1-> Text = ExtractFilePath (OpenDialog1-> FileName);

}
// ------------------------------------------------ ---------------------------
Reply

Use magic Report

0

Threads

11

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-2-16 16:15:01
| Show all posts
Don't understand why you use labels, aren't you displaying multiple lines now.
Isn't memo better, like that box of software copyright statement
Reply

Use magic Report

0

Threads

11

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 Invalid IP Address

Post time: 2020-6-1 13:00:01
| Show all posts
Add a Memo control Memo1
Memo1-> Visiable = false;
Memo1-> Clear ();
Memo1-> Text-> LoadFromFile ("D:\\1.txt");
Label1-> Caption = Memo1-> Text;
Memo1-> Clear ();

Hope there is a better way downstairs
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list