Solved

GroupBox Text Property

Posted on 2008-10-12
6
291 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 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

16 Experts available now in Live!

Get 1:1 Help Now