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

vb.net array problem

hello! i'm experiencing a problem with vb.net. here's the deal: i've created a simple array of buttons that when i click on them their text appears on a label. my question is how can i do the opposite: writing the one button's text in a textbox and then clicking ok(or enter) the program executes the button's code.
eg: 1st button's text asd1
2nd button's text asd2
3 button's text asd3
when i write in a textbox asd3 how can be executed the code of the 3rd button?(without rewriting the code as a case in the textbox)
thanks in advance
Aug 20 '07 #1
4 2560
Plater
7,872 Expert 4TB
Pretty sure you're going to have to use a case statement.

There's a FindControl() (or Find() depending on what your application type is, which you forgot to specify) that allows you to find a control by it's ID. So you could probably work something out like that.

I never understand why people want to run a button by it's name
Aug 20 '07 #2
ok here's the deal: i have an image with spots(little images of dots) on it. these images(spots) have a tag and by clicking on them a database is called by the tag (of the image) and shows the corresponding field of the database. while showing the fields, in the place of the clicked spot a label is showed in which appears the tag of the clicked spot. (all these are control by complexed arrays) what i want to do is to do the exact opposite: clicking the next button of the database and while a textbox is showing what appears to be a tag of a spot, i want to be called the label as if i had clicked the spot. is it so complex as it appears?
Aug 20 '07 #3
Plater
7,872 Expert 4TB
Well how is the "click" controlled with images of spots?
You could make a function called like IAmClicked(<some paramaters>); and have your image click call it and pass in the values it needs to know "what got clicked" or whatever.
Then you could do the same with your textbox things, call that function with the parameters to know what got clicked and where and the like?
Aug 20 '07 #4
ok i'll be more specific because my previous post wasn't understandable: a) there is a form in which appears a map (eg the globe)
from the code i create many pictureboxes which have these attibutes: image--> a dot, tag--> a name of country, left and top --> x,y of the country from the image.
b1) i've wrote a procedure that handles all these pictureboxes -array- and depending the tag, the program filters the database and shows in a picturebox the map of the country and in a textbox the name of the country (which was the same as the tag)
b2) by clicking a spot(country) another label is created, which takes the same text(as the tag) and position of the spot -also with array
c?) clicking the next button and while the map of the country and the name are appeared, i want the label to be called and "search" for the corresponding spot as if i had clicked the spot
Aug 20 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Federico G. Babelis | last post by:
Hi All: I have this line of code, but the syntax check in VB.NET 2003 and also in VB.NET 2005 Beta 2 shows as unknown: Dim local4 As Byte Fixed(local4 = AddressOf dest(offset)) ...
9
by: justanotherguy63 | last post by:
Hi, I am designing an application where to preserve the hierachy and for code substitability, I need to pass an array of derived class object in place of an array of base class object. Since I...
5
by: ritchie | last post by:
Hi, I am writing to ask if anyone can see why my array is not being sorted correctly? It's an array of 4 elements(ints 1,2,3,4) but after calling the selection sort it comes back sorted as...
8
by: Gerald | last post by:
I have a problem with an array of pointers. In a program I'm writing, I have to read a file, containing thousands of short lines. The content of another file will be compared against each line...
12
by: arkobose | last post by:
my earlier post titled: "How to input strings of any lengths into arrays of type: char *array ?" seems to have created a confusion. therefore i paraphrase my problem below. consider the...
204
by: Alexei A. Frounze | last post by:
Hi all, I have a question regarding the gcc behavior (gcc version 3.3.4). On the following test program it emits a warning: #include <stdio.h> int aInt2 = {0,1,2,4,9,16}; int aInt3 =...
8
by: intrepid_dw | last post by:
Hello, all. I've created a C# dll that contains, among other things, two functions dealing with byte arrays. The first is a function that returns a byte array, and the other is intended to...
104
by: Leszek | last post by:
Hi. Is it possible in javascript to operate on an array without knowing how mamy elements it has? What i want to do is sending an array to a script, and this script should add all values from...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
4
by: assgar | last post by:
Hi Seasons Greetings Its back, I am being haunted. I thought I had resolved this problem but I am intermittently the receving the warnings below. This code consist of a 1) HTML form, 2)...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...

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.