仅在标签中显示第一行文本? [英] Display First Line Of Text Only In Label?

查看:90
本文介绍了仅在标签中显示第一行文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在调试文件夹中有一个文本文件,希望在标签中显示.我的问题不是显示整个文本文件,而是仅显示标签的第一行.我已经阅读了一些有关如何执行此操作的信息,但其中包括我不希望看到的单击按钮事件.我希望它在程序加载时读取(在load事件中).

I have a text file located in my debug folder that I wish to display in a label. My problem is not displaying the entire text file but to only display the first line in my label. I have read a bit about how to do this but it includes a click button event which I dont desire. I would like it to read when the program loads (in the load event). Is this possible and will I need to create a private sub?

推荐答案

读取文件时,您可以读取第一行,跳出循环然后将此文本分配给文本框.

这是您要找的东西还是我缺少什么?
When you read the file, you can read the first line, break out of the loop and then assign this text to the text box.

Is this what you are looking for or am I missing something?


这篇关于仅在标签中显示第一行文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆