I have 5 pictureboxes on my form and would like to but then in a collection or array to use them in a loop. I would like to use the FOR EACH loop... but how..
Th pictureboxes are placed in a Table. Here is my code so far.
i'm making a program and a need to put some pictureboxes in an array, when i try debugging it gives me an error, i can't figure out what its having trouble with :S
Public Class Form1 Dim itemArrayXO() As Color = {picXO1.BackColor, picXO2.BackColor} Public Sub XO_Check(ByVal x As Integer)
[Code].....
(you may notice there are only 2 pictures in there, thats because im trying to get it to work before i go typing it all out)
I'm making a game which involves putting an array of picture boxes in a panel. I can see the picture boxes, but some are cut off where the panel ends. I have also used:
I have text for ToolStripStatusLabel1.Text in a file which is read into an array.
There is an array of PictureBoxes, which are used for the MouseEnter event.
I am trying to display different text in the status when the mouse is over a certain image. In the code below, the Array.IndexOf() generates "Index was outside the bounds of the array.". The commented line will change the text when I change the Index but, it changes it for all images.
How to place units and their men on the form but I cant seem to get this array to work. It has multiple errors in it.
Dim pic(calctroops()) As New PictureBox Dim z As Integer = 15 For i = 0 To Form3.orcunits For x = 1 To Form3.orc(orcunits) z = z + 15 pic(i).Location = New Point(Orc1.x + z, Orc1.y) pic(i).BackColor = Color.Green Me.Controls.Add(pic(i)) Next x Next i
I have a VB2005 project that displays 16 pictureboxes in a 4x4 grid which display CD album covers. In VB6 I could set up a control array i.e. picCD(0) to picCD(15), which made drawing the CD covers a snap. How do I accomplish this in VB2005?
It seems extremely cumbersome to have code like: If Len(path(0)) < 1 Then If Not IsNothing(PictureBox1.Image) Then PictureBox1.Image.Dispose() PictureBox1.Image = Nothing End If [Code] .....
I want to add an array to the class `StopwatchStorage` but can't figure out how without some ambiguous warning or error popping up. The Array will contain TimeSpan type elements (essentually an array of Stopwatch.Elapsed values)
How do I declare and add a dynamically sized array to the class. I know that I will have to use the UBound function each time I want to add a new array.
I am working with an XML web service using VB.NET, created using VS 2010. One of my web methods returns a collection(type that inherits from list) of custom objects. It's a simple return statement, it is my understanding that .NET handles most of the tricky protocol stuff as well as serializing/unserialzing of objects.
The issue is in my consuming application when I get the the return value of the web method that returns a custom collection I get an array of the custom objects. Is this normal behavior? It will be easy enough for me to take that array and insert it into a custom collection object but if I could I would like to skip this step.
Working on a project that tests up to 16 PC boards. The test routines are on a a backgroundworker thread. I want each PC board to perform the test routine on its own thread, so I would need up to 16 backgroundworkers.How do I go by doing this? Do I put 16 Backgroundworkers on the form? I tried to do it programmatically but I can't declare an array of backgroundworkers because withevents variables can't be typed as arrays. I guess I just need a kick in the right direction.
I have a group of boxes witch will all hold data input by the user. I am using an arraylist to store these, or atleast I am hoping to. So, the problem I have is getting the data to actually save to the arraylist. It keeps giving the error saying that type string cannot be converted to array list.
I have a collection which I wish to retrieve an array from in .NET 2.0. In other words, I want to convert a collection into an array. So far I have the following:
Public Class Set(Of T) Implements IEnumerable(Of T) Implements ICollection(Of T[code]....
I want to know how can I possibly copy a table with multiple columns and rows into an Array or Collection in VB.NET.I want to know the best solution because I want to use the code for 2 different tables and do some comparisons, and the second table has too many records.I was wondering if in VB.NET there is something similar to Hashmap used in java and a table could look like the following
How do I Display A HashSet As Either A Collection or an Array in the PropertyGrid.I wish there was some Attribute that allow me to display IEnumerable as an Array...but so far my attempts to do that have failed!My current solution is unacceptable in the new places I want to use it in
I am using 2 dimensional arrays for my work. My problem working with them they are incredibly slow for my work. I am starting the array with randomly assigning values (non zero) to the array. Most of the array values are zeros as shown in below form (e.g. 5 x 5):
I have a string array called m_DirFileList and a collection called myFileCollection. I'm trying to loop through the items in the collection and store each one in the string array. It's not working though.
I have a string array called m_DirFileList and a collection called myFileCollection. I'm trying to loop through the items in the collection and store each one in the string arrayIt's not working though. This is what I'm trying to do:
Dim myFileCollection As Collection = clsFTPClientClass.GetFileList(fileFilter, True) intItems = clsFTPClientClass.GetFileList(fileFilter, True).Count()
I tried this vb Dim matches As String() = Regex.Matches(tmpFieldContent, strEmail).Cast(Of Match)().ToArray() But it didn't work, as vb says 'Cast' is not a member of System.Text.RegularExpressions.MatchCollection'.
Is it possible to have a two-dimensional array/list/collection such as the following. The first dimension is to have 2 elements, 0 and 1. The second dimension I would like to be able to have a different number of elements for each of the elements in the first dimension. To explain better, I'd like X in array (0, X) to go up to say 4 and Y in array(1, Y) to only go up to say 2.
So there would be: array(0,0) array(0,1) array(0,2) array(0,3) array(0,4) array(1,0) array(1,1) array(1,2) But no array(1,3) or array(1,4).
I'd also need to be able to use Redim Preserve to increase the size of the second dimension for each of the first dimension's elements.
I have a parameterized query that displays the info (name, phone number, email addy) in detailed text boxes vice a normal DGV. I have coded a button to open outlook and populate the email address, but what I would like to do is have the user click another button that would add each email address into an array or collection from the desired records. Then, when they added all desired recipients to this "collection" they would hit the email button, which would open up outlook with the To: box already populated.*
I have looked into dynamic arrays , generic and special collections but am not sure what the best way forward is. When using the dynamic arrays I didn't really get anywhere, I couldn't seem to figure out how to redim with each addition of an email address.
Dim emaillist() As String Dim listings As Double Dim addy As String
I created a custom class for a custom object. I instantiate like so[code]...
Now, I have two problems. First, right now this is just overwriting the same object properties, again, and again. I need to somehow dynamically name the object. Then, I need to place these objects in an array so I can iterate through them...
I am working on my first VB application and have run into a problem. I am trying to loop through some data and displaying them in labels. I am using a for-each loop but end up with different row with the same labelname. What I would like to do, is to assign a number to the labelname (mylabel1, mylabel2,...), but I canīt figure out how, and I cant find anything online that will work. Here are some of the code that I have made, where I could use a solution to my problem...
I need to bind a textblock.text property to a single element in an observable collection, or array element, and have the text update using the INotifyPropertyChanged or INotifyCollectionChanged, whichever is best.
Most examples describe ways to bind listboxes or other list views to entire collections, but my application needs to update several textblocks on a screen depending on notification of a change in one or more elements of an array.
Is it possible to bind a single textblock to a single array element? Is it possible to get notification of the proper type that will update one or more of the textblocks if any assigned element changes?
I am creating a photo hunt game for grades 6-9 in summer camp. I want them to alter an image in paint then create two picture boxes. I want to put in ovals with no fill color to mark the differences in the picture but VB.net won't let me send the images behind the ovals.
Is it good practice to store sub-collections of item X inside a parent collection of item X for caching 'filter-queries' which are performed on the parent collection? (They won't be used together (as in color AND type).) Or is it also ok to just Loop over the collection and return the correct entities in a temporary collection?