473,320 Members | 1,724 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,320 software developers and data experts.

A to Z buttons

I am creating an inventory program, I would like to know how to create A to Z
buttons on runtime and than save data to the letter. Like if I hit F I will
get all the names that start with F
Nov 16 '05 #1
4 1130
You really need to tell us more about what you are trying to do. Where is
your data saved. "...get all the names that start with F..." Get from where?
A Database? An XML file? A Web service? A Flat file? Memory?

Help us help you!
"freddy" <fr****@discussions.microsoft.com> wrote in message
news:23**********************************@microsof t.com...
I am creating an inventory program, I would like to know how to create A to
Z
buttons on runtime and than save data to the letter. Like if I hit F I
will
get all the names that start with F

Nov 16 '05 #2
for (char l = 'A'; l<='Z'; l++)
{
Button b = new Button();
b.Text = l.ToString();
myForm.Controls.Add(b);
// set the location of the button here
// and add an eventhandler for the click event
}

"freddy" <fr****@discussions.microsoft.com> schrieb im Newsbeitrag
news:23**********************************@microsof t.com...
I am creating an inventory program, I would like to know how to create A to Z buttons on runtime and than save data to the letter. Like if I hit F I will get all the names that start with F

Nov 16 '05 #3
the data will be saved to an access db

"Smithers" wrote:
You really need to tell us more about what you are trying to do. Where is
your data saved. "...get all the names that start with F..." Get from where?
A Database? An XML file? A Web service? A Flat file? Memory?

Help us help you!
"freddy" <fr****@discussions.microsoft.com> wrote in message
news:23**********************************@microsof t.com...
I am creating an inventory program, I would like to know how to create A to
Z
buttons on runtime and than save data to the letter. Like if I hit F I
will
get all the names that start with F


Nov 16 '05 #4
Hi,

Do this :

Create a new class ButtonEx : Button
{
char letter;
ButtonEx( char whatLetter){ letter = whatLetter; }
}

then create as many controls as you need :
// CODE TAKEN FROM cody's post
for (char l = 'A'; l<='Z'; l++)
{
ButtonEx b = new ButtonEx( l);
b.Text = l.ToString();
b.OnClick = new EventHandler( letterButton_Clicked); /// <<=== the real
thing
myForm.Controls.Add(b);
}

void letterButton_Clicked( object sender ... )
{
//cast the sender to the new button
ButtonEx clicked = ( ButtonEx) sender;
//access the char
clicked.Letter;
//do as needed
}
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"freddy" <fr****@discussions.microsoft.com> wrote in message
news:23**********************************@microsof t.com...
I am creating an inventory program, I would like to know how to create A to
Z
buttons on runtime and than save data to the letter. Like if I hit F I
will
get all the names that start with F

Nov 16 '05 #5

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

Similar topics

8
by: Ralph Freshour | last post by:
Is it possible to inhibit the browser Back/Fwd buttons via PHP? Thanks...
4
by: Bob Lehmann | last post by:
Hi, I pretty sure I've seen this problem addressed before, but I can't find any references. The short story is that I have I have multiple submit buttons on a page, each providing different...
2
by: Aravind | last post by:
Hi folks. I have a form, frmHistory, which has 4 command buttons: Sort Title (cmdSortTitle), Sort Name (cmdSortName), Due Today (cmdDueToday), and Due List (cmdDueList). Sort Title and Sort...
5
by: Lyn | last post by:
Hi, I hope someone can help. I have a main form which mostly fills the Access window. In the bottom half of this form I have a tab control to display various types of data related to the main...
0
Denburt
by: Denburt | last post by:
This code is for a Toggle Button layout on a form, with this code you can set a number of toggle buttons visible and have multiple submenus that will stay hidden when not in use. My main menu is set...
4
by: Ron | last post by:
I want to create 10 buttons on a form at runtime, the code below is only creating one button labeled 1. Any idea what I am doing wrong? Public Class Form1 Public code(10) As String Public...
3
by: Ron | last post by:
Can anyone help me out? I am trying to add buttons numbered one through 10 at runtime to a form. I think they are getting added but they seem to be getting stacked one on top of each other. so...
2
by: dpazza | last post by:
Hi, I'm creating a quiz on using a form in VB 2005 express. I have four sets of questions and answers (labels and radio buttons) and I change between which set of questions is currently shown on...
4
by: Blasting Cap | last post by:
I have a page that has a number of radio buttons that will be displayed to different access levels of a user who logs in to my website. For instance, if there are a dozen buttons, user1 will see...
2
by: remya1000 | last post by:
hai i'm using Vb.net. i'm creating 64 dynamic created buttons of 8 rows and 8 columns. And i have 1 Go button, 1 textbox. those were created dynamically. if i enter one number inside textbox and...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.