473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

simple & drop-down combo/list box questions

Can someone tell me where in Properties to change a combobox/list from
simple to drop-down? I had it set to drop-down and couldn't remember
how to switch it back to simple. I don't know if it's being hidden.

The drop down listbox is named yachtLengthListBox, which should have
the list of 7 numbers already declared as constants, so I shouldn't
use the collection to enter them.

So I tried to use the statement
yachtLengthListBox.Items.Add(intLENGTH1.ToString() );
but it came up with an error. Am I allowed to put that code right
after the class-level variable declarations, and must I change some
property in yachtLengthListBox to do so?

--
Profile: http://mysite.verizon.net/vze8adrh/news.html
-Tim923 (Timothy Schmits)
Nov 16 '05 #1
2 4850
Hello Tim923,

How did you declare 7 numbers in constants? I'd use Enum or array int[] Numbers
= {1, 2, 3, 4, 5, 6, 7};

And you can't write code like yachtLengthListBox.Items.Add(intLENGTH1.ToString() );
at class level... You should have it on Form_Load or in its constructor.
So I'd do like this.

private int[] _Numbers = {1, 2, 3, 4, 5, 6, 7};
private void Form1_Load(object sender, System.EventArgs e)
{
foreach(int i in _Numbers)
comboBox1.Items.Add(i);
}

So about simple to dropdown... You're gonna figure that out yourself... Just
look into property window more carefully.
Can someone tell me where in Properties to change a combobox/list from
simple to drop-down? I had it set to drop-down and couldn't remember
how to switch it back to simple. I don't know if it's being hidden.

The drop down listbox is named yachtLengthListBox, which should have
the list of 7 numbers already declared as constants, so I shouldn't
use the collection to enter them.

So I tried to use the statement
yachtLengthListBox.Items.Add(intLENGTH1.ToString() );
but it came up with an error. Am I allowed to put that code right
after the class-level variable declarations, and must I change some
property in yachtLengthListBox to do so?
--
Profile: http://mysite.verizon.net/vze8adrh/news.html
-Tim923 (Timothy Schmits)

Nov 16 '05 #2
Thanks.

AllowDrop is the word. I was looking for DropDown.
--
Tim923, Static Profile: http://mysite.verizon.net/vze8adrh/news.html
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: srikanth | last post by:
Hi all, I have an requirement in one of my projects. We have one aspx page, in that we have two frames, in each frame having a tree structure control(dynamic data). In the left Frame we are...
1
by: Woody Rao | last post by:
I'm trying to drop all indexes and primary keys so that i can rebuild them (from a script created from same database on another server). when i go to the 'generate sql scripts', it has the...
0
by: K Finegan | last post by:
I have an archival process on a large database that runs once a month. At the beginning of the process the triggers and indexes on the tables whose data is moved are dropped, the data is moved and...
0
by: Plumer | last post by:
Hello everyone, Yesterday I posted a message about implementing drag & drop in a TreeView control. I'm having real difficulty getting this to work -- the process seems to be incredibly...
2
by: Ivo Tcholakov | last post by:
Is it possible to drag and drop controls in an aspx page at runtime ? Meaning i have developed a ASP.NET web form, the web form is now downloaded in IE - now can i have this form to detect mouse...
3
by: VB Programmer | last post by:
In VB.NET 2005 (winform) any sample code to drag & drop items between 2 listboxes? Thanks!
2
by: misower | last post by:
var c = document.getElementById("PanelTree"); // PanelTree is a <div> element! var n = document.createElement("div"); n.setAttribute('id', 'nu'); n.setAttribute('style',...
5
by: sesar | last post by:
How can I impement drag&drop for simple 'dialog base' application... I want to drag&drop txt file and load the text to variable
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
1
by: patrickq | last post by:
What am trying to achieve is dragging an element from one IFRAME/FRAME into another IFRAME/FRAME. But upon dropping the element, I do not want the target IFRAME/FRAME to open/load it. I want to set...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.