Control Arrays - Working With Indexes?

Dec 4, 2009

How I can make control arrays like vb6? I need for example,
button(1).backcolor=...
button(2). backcolor=... etc.
And I wanna work with it's indexes.

View 4 Replies


ADVERTISEMENT

Sort Two Arrays With Corresponded Indexes?

May 17, 2012

I have two arrays (array1 and array2)with double type data. I want to sort array1 to ascending order, and array2 with corresponding to the array1 indexes. Is this possible? Example below,

Array1(0) = 2.30
Array1(1) = 4.20
Array1(2) = 1.90

[Code].....

View 4 Replies

How To Use The Control Indexes

Feb 1, 2012

A very basic problem, sorry but I am new to .NET! I have a blank form that I populate say with 8 PictureBoxes (it doesn't matter what the control is, I've just picked one at random)In VB6 if I want to change any property of these controls, its very simple, because I can index the control eg:

For i = 0 To 7
MyPic(i).BorderStyle = 1
Next

How can this this be done simply in VB for any control in general?

View 2 Replies

Working With Arrays In VB?

Aug 7, 2009

working with arrays in VB? I need to take data that is being sent in this form:

228 -7.605553000000000E-03, -1.006126000000000E-03
6.341457000000000E-03, 5.457878000000000E-03
-1.504898000000000E-03, -8.575439000000000E-03

and put that into:

a11 a12 a13 a14 a15 ... a1x
a21 a22 a23 a24 a25 ... a2x
ax1 ax2 ax3 ax4 ax5 ... axx

The data is being sent from a network analyzer.

View 18 Replies

VS 2008 Working With Arrays?

Jan 28, 2010

working with arrays is not something I am too good at,Currently I have a form with 2 text boxes and a single button. I have two arrays, one populated with user names, the other populated with password. The user names and passwords match up in position in each array. I am thinking I might need to create a multidementional array of these two arrays.

[Code]...

If I do this however, any user name gets matched to any password, pending both exist. I would like to be able to compare the user name and password of a single user. Right now the user names and passwords are stored in separate arrays. Should I merge the two into a single array? If so how? And if so how do I go about matching the text box entries to the array(s) and making sure that the user name and password matches?

View 12 Replies

Working With Strings And Arrays

Jan 27, 2009

I was wondering if, perhaps, someone could help me understand why the following code gives me a garbled result? Instead of displaying as it should I get '.Net 2.0 Application Development Foundation Framework Microsoft'.[code]

View 2 Replies

Working With Arrays - Make It Global And On Form Load I Wanna Show It's First Position And On A Button' S Click

Apr 8, 2012

Dim LabelArray(12) As Integer
LabelArray(0) = Label3.BackColor = Color.White
LabelArray(1) = Label4.BackColor = Color.White

[CODE]..................

i have made an array. first of all i want to make it global and on form load i wanna show it's first position and on a button' s click i want to increase it's position by one how can i do that

View 2 Replies

Control Arrays During Runtime?

Feb 28, 2009

I am very new to vb .net. I want to create a set of arrays of textboxes during runtime of a program. For example when I click on a CommandButton it will ask me how many textboxes do I require as input. Then it will create that no. of textboxes instantly. This thing I have done in Visual Basic 6.0 but I can't do it here in .Net

View 3 Replies

Converting Control Arrays?

Jan 18, 2012

I've got an issue with control arrays from VB6 and converting that code to VB.net. It was suggested to me that the forum has a lot of info on what became of control arrays and each one I've found so far seems to indicate that VB.net has devolved in thatrespect.The solutions I've seen all involve writing segments of code to replace the simple functionality of a group name for a control and a simple index property. Perhaps I've not found the right thread, but it seems that VB.net is woefully lacking in control arrays. In VB6, all I had to do was C&P a control and click, 'Yes,' to create a control array when prompted by VB. The Index was automatically created and incremented for each successivecopy of the control. It was simplicity itself to merely reference the Index for a control group.

View 15 Replies

Create Control Arrays In .NET?

Mar 14, 2011

In VB6 there is a feature called Control Arrays, where you name controls the same name and provide them an index value. This allows you to set a value by looping through the controls and setting each value. In VB .NET I can't create a control array?

View 6 Replies

Textboxes And Control Arrays?

Jan 13, 2012

as always I'm here asking you a probably stupid question, but I'm upgrading an old vb 6 project, so I'd like to have all the new code more object oriented and as compact as possible.I have a groupbox containing some textboxes. Each of them is filled with the "selecteditem.tostring" property of a listbox everytime I press a button (call it "OK BUTTON"), and everything works fine.

Code below:
For Each ctrl As Control In GroupBox1.Controls
If TypeOf ctrl Is TextBox Then

[code].....

View 3 Replies

2 Dimensional Arrays Of Control Objects

Jul 11, 2009

I have the read the article "Creating Control Arrays in Visual Basic .NET" (link: [URL]) and I its very good and useful code for 1D array of objects. What if someone wants to make a 2D array of control objects. For example creating a "table" of 8x8 buttons that will be able to change properties by using the arrays x-y coordinates. Something like button(x,y). backcolor.black or similar.

View 3 Replies

Figured Out How To Do True Control Arrays In .NET?

Jun 20, 2010

Allowing adding/removing new controls at both design and run time, with event handling?

View 6 Replies

Use Different Coding In Various Elements Of Control Arrays

Apr 13, 2010

I have a control array of custom picture boxes on my form, say PibBox1, PicBox2 etc. Now, I want to access the individual click events of this control arrays. For eg: If we have three PicBox1, PicBox2, PicBox3 on the form, I want to move into the click event of each of these and assign a value to a variable PicSeletced =1, PicSeletced =2, PicSeletced =3 accordingly as the PicBox1, PicBox2, PicBox3 are clicked. But I don't know how to move into the individual click events of the control array.

View 13 Replies

Use Events Of Control Arrays In Program?

May 12, 2012

I have created control arrays in run time with following [code]...

But I don't know how I can have access to events now (especially textchanged)

For example I want when I write number in txtfrom (i+1) write it automatically in txtTo(i)

View 4 Replies

Accessing Controls On A Panel Without Using Control Arrays?

Mar 2, 2010

I have an application that has a grid of rich text boxes on a panel. I would like to access and modify the text in the various rich text boxes during run time. I know this has been brought up a bazillon times over the years, but I would have done this as a series of control arrays in VB 6. Below is a simplified representation of how the textboxes would appear in a panel if control arrays were availble:

rtbA(1) rtbB(1) rtbC(1)
rtbA(2) rtbB(2) rtbC(2)
rtbA(3) rtbB(3) rtbC(3)

I find that I can access the properties of the rich text boxes via panel1.controls.item(x).text, for example, where x is the control index assigned by the panel when I dropped the controls on it.

Since I created the rich text boxes at design time and dropped them on the panel, it has arbitrarily assigned the index values, and they are not in the index order that I would desire.

How does one re-assign a control's index at design time for a controls collection on a panel? And if one has 24 text boxes on one panel, is there a way to break them into subgroups, such as rtbA(), rtbB(), rtbC() with their own index values?

View 2 Replies

Control Arrays - Fill Array With A Loop

Jun 17, 2009

I am trying to port a program I wrote with old VB 1 and I have many control arrays in the program, and it was so easy to do this in older versions of VB, now I am trying to find how to do this and all the answers I have found are a major productions, to replace something that was so easy to do? I would think that microsoft would make programming easer with each new incarnation. instead they are making it harder. doing away with the DATA and READ statement, now it is much harder to fill an array with a loop, now you have to enter each item in an array ONE by ONE. they did away with the ON statement, I had several ON statements, I had to make complex Select case constructs. to replace a simple one word statement?

To make an array of controls in OldVB all you had to do is Name a Second control the Same as the First, and a dialog pops up and ask if you want to make an array, you click Yes, and that's it, what could be easier than this?

View 1 Replies

Control Arrays, Graphics Not Updating On All Controls?

Aug 25, 2009

Using MSDN documentation on creating Control Arrays in VB.net I proceeded to create a control array based on my UserControl. I modified the code programmatically to Loop through a For-Next loop to create 6 objects using the same UserControl. After creating these objects, I proceed to perform graphics on each control to draw a rectangle of which is in the center of the control by using a Timer_Tick event.

View 1 Replies

Populating Series Of Textboxes Using Control Arrays

May 22, 2012

I am having trouble with .net again. I have a series of 10 text boxes. I want to be able to populate them from an array and read there values into another array. In vb6 I would create a text box array with 10 text boxes / indices. I could then populate them by txtbox(i).text = arrVal(i) and to reference them arrVal(i) = txtbox(i). I am stumped I can create 10 text boxes on a form if I have to, but I want them somehow tied to each other as they were in vb6.

View 1 Replies

Visual Basic 2008 Control Arrays

Feb 21, 2010

I'm looking at controlling properties of an array of buttons in VB 2008 (express). I have been looking at the sample code from a whitepaper at MS, and it kind of makes my head spin compared to what was done in VB6! (and yes I'm an amateur

[Code]...

View 1 Replies

Control Arrays - Combobox Select A Datasource At Runtime

Jul 26, 2010

I have a form where I have to use control arrays to create a multiple input form i.e. rather than processing one transaction at a time up to 16 transactions must be processed. The following really havent given me much problems at this moment labels and textboxes. I use a for construct to create all the controls including a combobox. This is where my question comes in this form combobox has to be linked to a table in a database. But furthermore and this is where it gets complicated for me anyway each seperate combobox must move independly if i select row 5 in the table in combobox 4 combobox 5 which is havent touched should still be on row 1. How do I accomplish this. I'm using a webservice. I have tried passing a loaded dataset . The code that loaded the dataset is as follows

Dim DSInfo As New Project1.localhost4.AccInfo
DSInfo.Credentials = System.Net.CredentialCache.DefaultCredentials
InformationData.Merge(DSInfo.GetBusinessJournals)

[Code].....

this code doesnt however provide a link to the table equallly creating a dataset in the combobox method ,loading it and then setting it as datasource also provides no link. I know i'm missing something.

View 1 Replies

VS 2010 Displaying Property Arrays In PropertyGrid Control?

Feb 17, 2011

It seems as if the propertygrid control cannot display property arrays. Is this the case?

When I do this :
Imports System.ComponentModel
Public Class comPicturePirate
Private intAmountImages As Integer
Private strWebURL As String

[Code]...

View 11 Replies

Control Arrays - Allocating Multiple Camera Objects Dynamically

Jan 19, 2009

I have a VB.NET application and use some third party (closed source) ActiveX controls. One of the controls represents a "camera" (connected over several interfaces) and I try to write an example how to work with several cameras in one application. To do this I allocate multiple "camera" objects dynamically as an array which works as expected like this:

Const NUM_CAMERAS = 2
Private MyCameras(NUM_CAMERAS ) As xxx.MCamera

But the camera objects needs to be allocated with WithEvents because they raise events when a new image was taken. I found out that WithEvents variables cannot be typed as arrays and this is a pretty common problem so I also found some workarounds: [URL]. This is already pretty good and I adopted this to my concept. So I have a MyCameras array and a MyCamera all "without Events", first allocate a new MyCamera object, add a event handler and then put it into the array.

Unfortunately I get an error when calling
AddHandler Camera.ProcessModifiedImage, AddressOf MyHook

Normally "MyHook" is declared as
Private Sub MyHook (ByVal sender As Object, ByVal ModifiedBuffer As xxx.ProcessModifiedImageEvent) Handles Camera.ProcessModifiedImage

Like in the "Button examples" I just removed the "Handles Camera.ProcessModifiedImage" but I get an error that "MyHook" has not the same signature as the Delegate
Delegate Sub ICameraEvents_ProcessModifiedImageEventHandler(ImageIndex as Integer)

View 3 Replies

Control Arrays - Application Where Several Textboxes And Buttons Will Be Added To A Groupbox

Mar 19, 2012

I am trying to do an application where several textboxes and buttons will be added to a groupbox.

for example..

code:

I might have anywhere between 1 and 20 rows of these textboxes and buttons. I can add buttons on from.. but how would i add the textboxes or buttons to the say Procedure for MyButton_Click... Handles MyButton_1.click, MyButton_2.click

View 7 Replies

Control Arrays - Fill The Contents Of Several Text Boxes Using A FOR NEXT Loop

Feb 17, 2009

how to do something similar to what was a control array in VB6 in .NET? I would like to be able to fill the contents of several text boxes using a FOR NEXT loop or something similar..... corresponding the contents of an array with the texts of an equal number of text boxes.

[Code]...

View 3 Replies

VS 2010 Make Control Arrays - No INDEX Property Or Load Method Like VB6?

Feb 28, 2010

How can to make control arrays in vb.net ? there is no INDEX property or Load method like VB6. so how i can do it ?

View 5 Replies

Get String Between Indexes?

Jan 13, 2010

I've been searching for hours trying to make a Button event that removes all the text between two indexes in a list box. The two indexes are #FIRSTNAMES# and #LASTNAMES#... I have a code but it's WAAAY too confusing and it does not work. If anyone knows a way to do this, please let me know. I'll post my code just in case you don't know another way. I haven't gotten to the remove part, I'm still just trying to display the text between the indexes into a message box. I took most of it from Google pages... I really want an easier way, because I know there is one, but never the less I just need progress.

[Code]...

View 2 Replies

ArrayList Indexes Not Set Properly?

Aug 25, 2010

I have some basic code to fill items in an ArrayList as follows:

Dim intSteps As ArrayList = New ArrayList()
elect Case Session("type")
Case 1

[code]....

View 2 Replies

Getting Textbox Array Or Indexes?

Apr 26, 2011

I have some problem doing my practice in vb .net, what im trying to do is to array or do indexes my textbox, for an example i have 5 textbox,i would like to do like vb classic version, like this:

Textbox1(1).text
Textbox1(2).text
Textbox1(3).text

[code]....

View 1 Replies

Textbox Array Or Indexes?

Dec 24, 2010

I have some problem doing my practice in vb .net, what im trying to do is to array or do indexes my textbox, for an example i have 5 textbox,i would like to do like vb classic version, like this:

Textbox1(1).text
Textbox1(2).text
Textbox1(3).text

[code].....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved