Showing posts with label box. Show all posts
Showing posts with label box. Show all posts

Saturday, March 24, 2012

Newbie: Save and display multi-value listbox... (VB.NET)

I have a list box (i.e. FieldA) that allows the user to select more than one option. When saved, this field content is inserted in a table.

My questions are:
- How do i loop through this listbox and save the data. Do i need to concatenate the selected options into a string before or during saving?
- When this saved record is retrieved from the table, do i need to do anything in order to display the options that have previously been selected and saved?
I appreciate any coding that you can provide to assist me...

Try this article, it was helpful to me when I dealt with this same issue.
http://www.developerfusion.co.uk/show/4653/

Friday, March 16, 2012

newline within a string

How can I insert a new line character (\n?) within a string in C#, so that when I display the string in some text box the string is displayed in multiple linesHi,

you can use System.Envirnment.NewLine() method to insert newline. Also if you are using Multiline textbox then I think you need to do something like this:


string AllText = TextBox1.Text.Replace(System.Envirnment.NewLine(),"<BR>");


What I am trying to do is

string strnewline;
TextBox1.text=strnewline;

Now I want to define the strnewline such that
TextBox1.text=strnewline;

displays the text in multiple lines. TextBox1 is multilined.

In short, is there any alternative to C-lang "/n " ?
check the code that I gave you it works !!!!