By Callum


2018-10-11 14:15:55 8 Comments

Looking for a way to display a default value in a list box when launching the program e.g. the second the program is launched a default value is held and displayed in that list box until the user adds their own input?

Any ideas?

1 comments

@user1011627 2018-10-11 14:21:27

You can set a collection of items in the properties window at design time or you can add via code as shown here:

private void Form1_Load(object sender, EventArgs e)
    {
        listBox1.Items.Add("Default Value");
    }

Related Questions

Sponsored Content

22 Answered Questions

[SOLVED] Cast int to enum in C#

  • 2008-08-27 03:58:21
  • lomaxx
  • 1085963 View
  • 2698 Score
  • 22 Answer
  • Tags:   c# enums casting

57 Answered Questions

[SOLVED] What is the difference between String and string in C#?

41 Answered Questions

[SOLVED] How to create Excel (.XLS and .XLSX) file in C# without installing Ms Office?

  • 2008-09-29 22:30:28
  • mistrmark
  • 948486 View
  • 1641 Score
  • 41 Answer
  • Tags:   c# .net excel file-io

26 Answered Questions

[SOLVED] Why not inherit from List<T>?

22 Answered Questions

[SOLVED] How do you give a C# Auto-Property a default value?

9 Answered Questions

[SOLVED] What are the correct version numbers for C#?

26 Answered Questions

[SOLVED] How do I enumerate an enum in C#?

63 Answered Questions

[SOLVED] How do I calculate someone's age in C#?

  • 2008-07-31 23:40:59
  • Jeff Atwood
  • 502622 View
  • 1743 Score
  • 63 Answer
  • Tags:   c# .net datetime

296 Answered Questions

[SOLVED] Hidden Features of C#?

  • 2008-08-12 16:32:24
  • Serhat Ozgel
  • 634824 View
  • 1476 Score
  • 296 Answer
  • Tags:   c# hidden-features

Sponsored Content