Solved

GroupBox Text Property

Posted on 2008-10-12
6
283 Views
Last Modified: 2010-04-23
Hi I'm using VB 2005, WinForms. I have a GroupBox on my Form and I've set the GroupBox's "DropDownStyle" property to "DropDownList". This prevents any users from entering  anything into my GroupBox that is not part of the Items collection. That works OK, but I cannot set the GroupBox.Text property to anything as a default.

I wanted to change the  GroupBox.Text property to "Please select one...", but VB does not allow me to do that.

Is there any way to set a default value or blank out the visible value, so that the user has to make a choice as to which item they want to select?

Thanks,
Fulano
0
Comment
Question by:Mr_Fulano
  • 3
  • 3
6 Comments
 
LVL 48

Expert Comment

by:jpaulino
ID: 22698896
GroupBox or Combobox ?
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 500 total points
ID: 22698906
I assume it was a typo.
You can do this:

        ' Set as empty

        Me.ComboBox1.SelectedIndex = -1
 

        ' Add a new item to the top of the collection

        Me.ComboBox1.Items.Insert(0, "Please select one ...")

Open in new window

0
 

Author Comment

by:Mr_Fulano
ID: 22699103
Big Typo...Sorry, I meant ComboBox
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:Mr_Fulano
ID: 22699114
Hi JPaulino, man you sure do know a lot of neat tricks!!!  Good answers.

Thanks,
Fulano
0
 

Author Closing Comment

by:Mr_Fulano
ID: 31505498
Good answers!!!
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 22699117
>> Hi JPaulino, man you sure do know a lot of neat tricks!!!
:)
Glad I could help and thanks for the grade
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now