开发者

Add text in textbox that will show only when clicked

I load files to a TextBox, and I would like some of the information to be hidden and replaced with a LinkLabel (that says something like 'click me to see more'). only when the LinkLabel is clicked will the extra information be shown. the information to be hidden is marked with "/" in the file. Can you think of a way to do this? Is it possible? Thanks.

EDIT: Here is an example.

File: Hello everyone have a /nice day/ today and have a nice day /tomorrow too/. Good bye.

TextBox should show: Hello开发者_Python百科 everyone have a 'click me to see more' today and have a nice day 'click me to see more'. Good bye.

If the first LinkLabel is clicked TextBox should show: Hello everyone have a nice day today and have a nice day 'click me to see more'. Good bye.


How about using a RichTextBox instead and handling the RichTextBox.LinkClicked event? In the event handler you can replace the link with the actual text. The RichTextBox has auto url detection, so it can find and create the links for you.


You cannot put clickable zone inside a normal textbox. You have to declare a personal user control that inherits textbox an handles the click over the text


You can put that extra info into Panel (You can find it in Toolbox-->Containers). When somebody click LinkLabel you can do this:

Panel.Visible = true;
LinkLabel.Visible = false;

That would do the trick if I understood your question.


If I understand you correctly, your Link Labels are "hiding" the text. What I'd do is assign the hidden text on the Tag property of each of my Link Labels and when they are clicked, swap the Tag into my TextBox.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜