Questions tagged [control-array]

34 questions
10
votes
9 answers

What's the simplest .NET equivalent of a VB6 control array?

Maybe I just don't know .NET well enough yet, but I have yet to see a satisfactory way to implement this simple VB6 code easily in .NET (assume this code is on a form with N CommandButtons in array Command1() and N TextBoxes in array…
raven
  • 18,004
  • 16
  • 81
  • 112
3
votes
3 answers

vb6 - how to find largest element index in control array?

I am dynamically loading and unloading an array of command buttons on a form. I can do this: Dim UnloadIndex As Integer For UnloadIndex = 1 To 20 Unload frmMain.cmdAction(UnloadIndex) Next But I don't always have 20 elements. Is…
itsols
  • 5,406
  • 7
  • 51
  • 95
2
votes
2 answers

Creating control from 'control array?'

I have an array of picture boxes as so: Dim pieces(500) As PictureBox pieces(1) = New PictureBox With pieces(1) .CreateControl() .Visible = True .BackColor = Color.Red .Width = 50 .Height = 50 …
Skeela87
  • 701
  • 6
  • 12
  • 17
2
votes
3 answers

VBA Command Button array

I'm currently working on a project where I'll be selecting up to 5 items to compare to each other, with the results being displayed in up to a 5x5 dynamic grid. My objective is to have this grid be composed of command buttons such that the caption…
Andrew
  • 23
  • 1
  • 4
2
votes
2 answers

How to create an array of buttons in C++

I'm using C++ in VS2005 and have an 8x8 grid of buttons on a form. I want to have these buttons in an array, so when I click on any of them it will open the same event handler (I think that is what they are called), but I will know the index of…
user324667
  • 41
  • 1
  • 3
2
votes
1 answer

VB6: Some control array element properties are unavailable

With refactoring some old VB6 code I stumbled upon some really weird behavior. When I try to set the DragMode property of an element of a control array, the compiler tells me 'Method or data member not found' when I separate this control from its…
Vincent
  • 23
  • 4
2
votes
3 answers

Control array type loop in C#/ASP.NET

I am writing a C#/ASP.Net web application and I have a large number of text boxes that need to be set to variable values in the code behind. Currently I am doing the following: AspTextBox0.Text = codeBehindVariable[0]; AspTextBox1.Text =…
user1751128
  • 21
  • 1
  • 2
1
vote
4 answers

How can I get the array index of a given object in C# with control arrays?

I am dynamically adding a bunch of controls to a form. Each control calls the same method, and in that method I need to know the array index of the the control that performed the action. CheckBox[] myCB = new CheckBox[100]; int i; for (i = 0; i <…
Adam Davis
  • 91,931
  • 60
  • 264
  • 330
1
vote
2 answers

How to bind a function to Click event of each control in an array of controls in C#

When you create an array of controls in C#, how can you bind a function that receives the index of the clicked button to their click event? Here's some code solely for better understanding. Somewhere on top of the code you define the buttons: Button…
Hossein
  • 4,097
  • 2
  • 24
  • 46
1
vote
1 answer

Creating an array of Command Buttons

I am in a situation Where I need to Create multiple Command buttons and assign a single event handler to these buttons using following Event Handler. Private Sub Digits_Click(Index as…
VBAbyMBA
  • 806
  • 2
  • 12
  • 30
1
vote
1 answer

Is it possible to delete control array element?

I Delete control array element using Unload and try to replace element using following code Private Sub mnudelete_Click() Dim i As Integer MsgBox (SelectedItemIndex) RoomIndex = SelectedItemIndex Unload frmData.lblRoom(RoomIndex) Unload…
Anugrah
  • 39
  • 1
  • 11
1
vote
1 answer

Microsoft.VisualBasic.Compatibility.VB6.LabelArray obsolete and supported within 32-bit processes only

I'm migrating an old project from VB6 to VB.NET and I have faced the above warning. I also received the same warning for Microsoft.VisualBasic.Compatibility.VB6.ProgressBarArray. What are the nearest equivalents to these control arrays that keep the…
disasterkid
  • 6,948
  • 25
  • 94
  • 179
1
vote
1 answer

visual basic 2008 control arrays

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, so please…
Bart Silverstrim
  • 3,445
  • 6
  • 34
  • 44
1
vote
2 answers

C# handle control array event caused by another control

I am working on a winforms html editor with multiple editor windows as each editor window will be written to a database field. I am creating the editor windows as a control array and was hoping to just have one toolbar above them that would handle…
PeteT
  • 18,754
  • 26
  • 95
  • 132
1
vote
1 answer

Problems with ShapeArray and converting it to C#

I have converted a VB6 application to VB.NET, because eventually I want to convert it to C#. But I have problems in regard of ShapeArray that inherits BaseControlArray. These are my problems : I create a RectangleShapeArray class in the VB .Net…
pilus
1
2 3