473,406 Members | 2,698 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,406 software developers and data experts.

A -> Z in listbox

Hello,
I would like to populate a listbox with values A to Z. What would be the
best and fastest way to do this?
I tried to use a for-loop but I don't know how I would change the current
char value to the next letter.
Nov 20 '05 #1
7 1292
use ascii
"ZippyV" <do**@mail.me> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello,
I would like to populate a listbox with values A to Z. What would be the
best and fastest way to do this?
I tried to use a for-loop but I don't know how I would change the current
char value to the next letter.

Nov 20 '05 #2
Hi,

For i As Integer = 65 To 90

ListBox1.Items.Add(Chr(i))

Next

Ken

--------------------

"ZippyV" <do**@mail.me> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello,
I would like to populate a listbox with values A to Z. What would be the
best and fastest way to do this?
I tried to use a for-loop but I don't know how I would change the current
char value to the next letter.

Nov 20 '05 #3
Cor
Hi Ken,

I use aways (with the dataset in samples)

For i as Integer = 0 to 26
Listbox1.Items.Add(Chr(i+65)
Next

And then I see it from you and then I think, "funny how things who are the
same can look so different".

Cor
For i As Integer = 65 To 90
ListBox1.Items.Add(Chr(i))
Next

Nov 20 '05 #4
* "Cor" <no*@non.com> scripsit:
I use aways (with the dataset in samples)

For i as Integer = 0 to 26
Listbox1.Items.Add(Chr(i+65)


This will give a compile error. And why do an addition in every
iteration?

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
Cor
> >
For i as Integer = 0 to 26
Listbox1.Items.Add(Chr(i+65)


This will give a compile error. And why do an addition in every
iteration?

;-)

Not as you add that last character you did send.

I only wrote this because that when I saw it, I thought, yes it can also in
that way and who would think in this kind of solutions what is better or
worse.

I got my answer,

Thank you

:-)))

Cor
Nov 20 '05 #6
Cor,

* "Cor" <no*@non.com> scripsit:
For i as Integer = 0 to 26
Listbox1.Items.Add(Chr(i+65)


This will give a compile error. And why do an addition in every
iteration?

;-)

Not as you add that last character you did send.

I only wrote this because that when I saw it, I thought, yes it can also in
that way and who would think in this kind of solutions what is better or
worse.


LOL

:-)))

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
On 2004-02-18, ZippyV <do**@mail.me> wrote:
Hello,
I would like to populate a listbox with values A to Z. What would be the
best and fastest way to do this?
I tried to use a for-loop but I don't know how I would change the current
char value to the next letter.


Well you've seen a bunch of code, so I won't boar you with my own
implementation... But, I will ask why not just edit the list boxes
items collection at design time? It's only 26 entries after all :)

--
Tom Shelton [MVP]
Powered By Gentoo Linux 1.4
Your wig steers the gig.
-- Lord Buckley
Nov 20 '05 #8

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

Similar topics

6
by: Christina | last post by:
I want to read a classic HTML Form using the ASP Request object on the server. This is a common approach. But how can I read all the contents of a listbox (the <select> tag)? Best regards,...
5
by: Peter Hunt | last post by:
Hi, I'm trying to change a listbox into a draglistbox so that the items can be arranged by the user. I found lots of examples on the web, but all of them are different and since I've just...
4
by: headware | last post by:
I have a <select> control that contains many entries. It allows the user to multi-select a group of them, click a button, and store the selected data in a database. Normally they do this starting...
1
by: Mike | last post by:
My users have to select an value from a fixed selection of values. The obvious choice of control for such a requirement is to use a <select> (i.e. a combo box). My problem is that sometimes,...
2
by: JoeHenrich | last post by:
I am using VS.NET 2003 and am having an interesting issue with a Listbox control. Essentially, I have a form with a listbox on it. In the listbox doubleclick event I would like to do some...
4
by: Sally | last post by:
Any ideas on how you handle this in the control? I am using C# if that matters. Want to pass an array or even do id.AnArray=myarry; -Sal
3
by: Ryan Taylor | last post by:
Hello. I have an application where I need the user to be able to add items to a listbox. I've implemented this via javascript. The listbox is an <asp:ListBox>. However, when the user submits the...
2
by: rudy | last post by:
how do I create a list box that I can use to filter the records in another list box on a form.
2
by: =?Utf-8?B?Sm9uYXRoYW4=?= | last post by:
Hi I so new to vb.net that the paints still wet... I would like to load a listbox (as I would do using vba). The properties show multicolumn = true column width = 300 How do I set the...
1
by: Jeff | last post by:
hi asp.net 3.5 (project upgraded from asp.net 2.0). are using vwd2008 express now This is my first ajax attempt. The code below shows a TextBox and a ListBox. The idea I was trying to...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.