Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
Okay, so I'm working on a text editor that will maintain a butt-load of macros( for use with HTML, really ). I've decided on a split container with a rich text box on the big side, and a list box and three buttons on the small. The list box will display the macros ( e.g.
"<-a href="http://www.baldwin.senate.gov"><img src="images/Democrats/baldwin-tammy.jpg" />" - and 99 more quite like that ), and the buttons will allow adding, deleting, and modifying them.

I can't seem to find adequate explanation ( read: hand-holding ) for binding a List<string> to the listbox or making the List<string> update with there was a <-return> pressed in the textbox.

Here's the plan: Click the 'Add' button, a textbox pops up, enter macro text, hit <-return>, textbox goes away, the text that was entered shows up in the listbox. And, what might need rethinking, I want to click the lines of text ( individually, of course ) in the list box and have them inserted into the rich textbox at the current caret position.

Any help with any part of all that ( or even pointing me at a good tut ) would be much appreciated. Thanks.
Posted
Comments
Florian Braun 21-Apr-15 1:47am    
regarding the binding of a list and a listbox i'd suggest this small tutorial: http://www.dotnetperls.com/listbox
It shows how to add and delete items/lines.

the Textbox that pop up, is it an additional form (like a dialogue-form for opening or saving files)? in this case you have to make the content of the textbox public to get access from your main form.
Member 10813407 21-Apr-15 10:22am    
Thanks for that listbox tut. And the popup - I just want a box to type in. It appears that dotnetperls has that covered as well. Nice.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900