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

Control Array Error?

Can someone tell me what a "Control array error" is and how to fix it?

Heres the error i get "Control Array Element "0" Doesn't Exist" And it's with the following code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  2. If PicOpponent(Index).BorderStyle = 0 Then
  3.     For i = 1 To 5
  4.         PicOpponent(i).BorderStyle = 0
  5.     Next i
  6.     PicOpponent(Index).ZOrder
  7.     PicOpponent(Index).Height = 1512
  8.     PicOpponent(Index).BorderStyle = 1
  9. End If
  10. End Sub

It highlights "If PicOpponent(Index).BorderStyle = 0 Then"
Feb 14 '09 #1
2 1983
please anyone help me
Feb 15 '09 #2
vdraceil
236 100+
To make a control array at runtime you need to place a base control with index property=0 at design time.
If you need to have 5 picture boxes all with the same name,you'll have to create PictureBox1 at design time with its 'index' property set to 0.Now you can load other controls by,
For i = 1 to 5
Load PictureBox1(i)
PictureBox1(i). Visible = True
Next i

So,try setting index=0 for PicOpponent control in your form..
Feb 15 '09 #3

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

Similar topics

4
by: The Mess | last post by:
I would like to pass a Control array of OptionButtons that I created at run time to a Sub. Say I have Opt(0), Opt(1)......Opt(5) as OptionButtons, is there a way to pass Opt to a function and...
6
by: chxant | last post by:
Hi, I want to use a parameter in a control name. Something like this: i=1; (CheckBox + i).ID="test"; Is this possible?
3
by: Christopher | last post by:
Hi I need to know how to work with a control array in c#. I would like to clear the contents of a textbox array after adding up the values in the textboxes. This is really easy in VB6 - im sure...
1
by: Zenobia | last post by:
How do I bind an array, arrayList or even a stack to a repeater containing hyperlinks. The data structure (array, arrayList or even a stack) has dates in ISO format "YYYY-MM-DD". The repeated...
7
by: Tom wilson | last post by:
I'm trying to create dynamic controls in ASP.Net. It's driving me nuts. I keep getting the error: Control '16' of type 'RadioButton' must be placed inside a form tag with runat=server. Dim...
4
by: bienwell | last post by:
Hi all, Data displayed on the datalist control is bound by the column name of the dataset like this : <%# DataBinder.Eval(Container.DataItem, "title")%> Could I use an element of the array...
0
by: Tom | last post by:
I am having a really annoying issue with serialization and a .NET User Control I am writing. For example, let's say I have a couple of classes in my control - first class is like: Public Class...
2
by: George | last post by:
Is there a fast way to transfer an Excel range to an array? Example: Excel range is E2:E300 Dim person() as string Thanks, George
3
by: Joseph S. | last post by:
Is there a system available to do the following: consider an app of a few pages: page1.php: form1----->page3.php form2----->page4.php page2.php: form3----->page3.php form4----->page4.php
6
by: Rich | last post by:
Hello, I have an application that contains several checkboxes. I originally created this app in VB.Net 2003 and upgraded the app to VB.Net 2005. I understand the vb2005 supports control...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.