VS 2008 - How To Create ArrayList From MDI ChildForms
Aug 11, 2009
I want to create an arraylist from MDI childforms and I did it like this:
vb.net
Dim sl As New SortedList(Of Integer, Form)
Dim i As Integer
Dim form As Form
For Each form In Me.MdiChildren
[Code] .....
It's working great, that means that if I delete a childform for example number 2 from all 3 then it creats first number 2 again and then number 4. Now the problem is that It only shows the childformnumber in the parentformtext instead of the name and number of that childform,like this: parentform - childform 1
View 8 Replies
ADVERTISEMENT
Apr 21, 2011
may i have an simple example to create,initialize an multidimensional arraylist some thing like
Dim i As ArrayList()()() and add / retrieve the values from specified indices
View 4 Replies
Sep 21, 2010
What I need to do is read an ArrayList in My.Settings and add another ArrayList to it. The first think I'm trying to do is load My.Settings.Records into myArrayList. I'm not quite sure on the proper way to do this. I've tried things such as Dim myArrayList As ArrayList = My.Settings.Records, I'm not sure if I need New and I'm not sure if I need .Clone or .CopyTo.
Then I have another ArrayList myArrayList2. To get this into myArrayList I've done: [Code] Then to save it back to My.Settings I've done. My.Settings.Records = myArrayList. The problem is I keep on getting Object reference not set to an instance of an object error on the AddRange line. My.Settings.Records is definitely an ArrayList and it will sometimes = Nothing. The objects will only ever be strings.
View 19 Replies
Mar 20, 2012
I want to create an array of an array (or arraylist of an arraylist) to hold strings.I want to fill an array1 with string values Then add this array to array2. - but only taking up 1 row in array2 e.g something like array2(index)=array1 Then clear array1 then loop through this again with different data, and add it to the array2.so will end up with something like
array2(0)... contains a collection of array1 data
array2(1)... contains a collection of different array1 data
.. and so on
i think i need to make new instances of array1 each loop, but not sure.I dont mind if it uses arrays, or arraylists, or lists, or structure of arrayslists?
View 6 Replies
Jun 9, 2011
I'm trying to create multiple instances of a child form. This form has an event that feeds a string variable back to the parent so I'm declaring it with WithEvents which is declared outside of the Sub - meaning multiple clicks will not open multiple forms.
another method of doing this while keeping the event?:
Dim WithEvents FRestoreDB As New FormRestoreDB()
Private Sub BtnOpenDB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOpenDB.Click
[Code].....
View 2 Replies
Oct 4, 2010
Here is a simplified hierarchy of a application I want to create:
1. Mainform - here should be a navigation pane, where a user can choose which modul he wants to use.
2. Childform Reports, Childform Maintenance, Childform To Do, Childform Management, ... - depending on which modul of the program the user wants to work with, a proper childform will appear as the main working part of the application
3. Childform CostReport, Childform TurnoverReport, Childform EmployeesReport, ... - if user wants to work with Childform Reports (chosen in 2. paragraph) he can work with one of these childforms.
I wanted to do this with MDI childforms, but visual basic keeps telling me that a form can be a MDI container only as a toplevel, which Childform Reports isn't. So i can make the program till 2nd paragraph but when i want to make the 3rd, its a problem.
I put the error here: "Top-level style of a parented control cannot be changed.
Parameter name: value"
Is there a workaround?
Maybe i could use TabControl for the 3rd paragraph, but its not that convient, since I want to use more "tabs" or forms...
View 9 Replies
Sep 17, 2009
Can I create a 2 dimensional arraylist in VB.net?
View 3 Replies
Nov 5, 2009
I am trying to create an arraylist of LinkLabels and am having the hardest time with getting everything to work and understanding event handlers. Here are my declarations:
Public Class Form1
#Region "Globals"
Dim arrayLink As List(Of LinkLabel) = New List(Of LinkLabel)
[code]....
I receive the error that Class 'System.Windows.Forms.LinkLabel' cannot be indexed because it has no default property'.
View 6 Replies
Feb 11, 2010
I use serializer classes for storing data and each class can hold an array of objects for the same class which is a key feature of the class. I declare this array as so:
myClassObjects(1000) as myClass
My question is- can I declare the array as an arraylist so I can sort and count objects in the array(list) quicker and easier and are there any drawbacks to taking this approach?
View 1 Replies
Nov 5, 2009
What is the easies way to create a arraylist of one type
View 2 Replies
Dec 1, 2011
What I am doing is iterating through all the groups that belong to the top group (Generic reports). Then I take advantage of the GroupPrincipal.GetMembers(True) which will recurse through a given group name. I test to see if the user exits under that group and if true I put the group name in an arraylist.
I use the for each principal in GroupPrincipal.GetMembers to loop through each returned user to see if they exist.
Is there a way to put all the returned users Principal.Name from a given group in GroupPrincipal.GetMembers into an ArrayList? This would allow me to to use Arraylist1.IndexOf to search for user. Which would be much faster then iterating through a returned list using the for each construct.
Sub RetAllMbrs(strUser As String)
Dim oPC As PrincipalContext = GetPrincipalContext() '<- this is function somewhere else in the code
[Code].....
View 1 Replies
Jan 11, 2012
I have a problem in Treading.I have a code like this;[code].....
I want to change ListBox1 with ArrayList. But I couldn't find how to use adding a string to ArrayList in tread.
View 5 Replies
May 6, 2010
I have an arraylist (arrFirstArry) which I use to populate another arraylist (arrNoDuplicates) preventing any duplicates from being added. This works fine. What I would also like my code to do is prevent adding any partial values which may exist from being added. i.e. my array is like this
[Code]...
View 2 Replies
Sep 22, 2011
I have two structures Public Structure myResearchData
Public batchName As String
Public arraylistRData As ArrayList
End Structure
Public Structure myResearchSubData
Public researchDescription As String
[Code]...
Cleared MyResearchData.arraylistRData for new data to be put in but it also clears the arraylist inside MyResearchDataAList and didn't old the contents of the arraylist
View 1 Replies
May 8, 2011
I would like to know if there is anyway to save arraylist to xml. Below are my code,
vb
Public Class Video
Public vName As String
Public vFile As String
Public vType As String
Public xTL As Integer
[Code] .....
View 1 Replies
Mar 23, 2009
I am new to arraylist. I have used standard 2 dimension or single dimension arrays which is there is .net & legacy VB.What I want is removing & searching in arrays to be easy ? VB.net does provide something called arraylist whereby we can remove items easily like X.removeat (index) or x.remove (search) etc.[code]Now I have a array person. To add i do redim person(10) or using preserve if I need to dynamically add etc. To remove is a pain as I need to copy contents and remove manually.Anyways in .net you have option called ArrayList.How can I use this to make life easier? If I want an arraywhereby I can do person.removeat (2) or person.add person.name="XYZ" & so on.Just wanna ease up on searching & removing.
View 6 Replies
May 12, 2011
I know how to seralize my arraylist to xml using vb.net?
View 2 Replies
Oct 11, 2009
I'm trying to use my own structure as a dynamic array (ArrayList?) but can't find the right syntax.
Public Structure BLsCompsRootDir
Public BL As String
Public Component As String
[code].....
View 7 Replies
Oct 13, 2011
I can do this with a for loop, but I was just curious if an arraylist can be updated using a for each loop. ie
For Each arrItem As String In myArrayList
arrItem = "My Stuff"
Next
If I loop through the arraylist again the values remain unchanged.
View 4 Replies
Aug 25, 2010
I have a windows app and I'm trying to cache images in memory. I have:-
[code]...
I think I have to sort the array to be able to use binarysearch.So I need to sort the arraylist on TileDetails.TileURL(if possible) and then binarysearch on it.
View 10 Replies
Jun 30, 2010
I have a access db that contains logs in it from a project of mine. I have set up a total of 10 columns per row for log ids to be inserted ex: Log_1, Log_2, Log_3, etc...
The logs are pulled from an XML file that I downloaded and extracted from in an array list: log_id_1, log_id_2, log_id_3, etc...The db columns are a fixed number, 10. While the log id in the array list are variable, from either none upwards to about 20 of them.
If my arraylist has more entries in it than db has positions, I dont get an error, but if my array list has fewer than the 10 fixed columns in the db, I get an index error.What should I do to fix the error, capture the error and ignore it or is there another, better method?
View 4 Replies
Apr 28, 2011
how do I do the code if I wanna delete a selected item from the array list and not all the items store in the array list? [Code]
View 2 Replies
Mar 23, 2010
I need to know how to save listbox items into ArrayList And restoring these items back from Arraylist into Listbox I tried this code but it returns Null Error Exception
[Code]...
View 2 Replies
Mar 6, 2009
the vars outside the procedure
Dim rentalRecords As New ArrayList() ' The arraylist containing the records
Dim carRecords As New ArrayList()
Dim currentRecordIndex As Integer ' The index of the current record
[code]....
View 1 Replies
Dec 20, 2009
I want to have multiple threads input data into the same arraylist, so they would need to share it. If this is possible how can I do this task?
View 1 Replies
Jun 18, 2010
I am working with an ArrayList of ArrayLists. Every time I add a new ArrayList to the main AL, it replaces all previously added ALs with the new one.Here's an example
Dim al As New ArrayList
Dim al2 As New ArrayList
Dim list() As String = {"one", "two", "three"}
[code].....
I would expect the Final line should be "Final: one, two, three" but that is not the case. And if I pause and check my ArrayList (al), it shows 3 items, that all have "three" in every spot which is what the last AL I added looked like.
View 2 Replies
Mar 8, 2011
I have a arraylist with plenty of lines. The array is populated from documents that have all kind of stuff in them, I got no control over what they contain. There's blank lines and double linebreaks so when I want everything in a textbox I clean it using this
[Code]...
View 3 Replies
Mar 31, 2009
My application reuses the same data returned from the database throughout the application. For example, a list of airport codes retrieved from the dataabase could be used on 5 different forms. In VB6 I placed the information into a Public Array. I'm looking for the best way to load and make available without hitting the database 5 times. After researching I found arraylist might be the way to go. My problem...I'm not sure I'm doing this correctly and not sure how to make the call to get the data out of the list.
[Code]...
View 4 Replies
May 16, 2010
I have an arraylist of a "Doctor" class containing Firstname, Lastname,etc. Some elements in this arraylist may be duplicates of others. I am trying to iterate through the arraylist and search for duplicates. Once i find a duplicate i want BOTH duplicates put into another array and removed from the original array.
here is my function
Public Function createArrayOfDuplicatesAndRemove(ByVal st As ArrayList)
Dim duplicates As New ArrayList()
Dim i, j As Integer
[code]....
How could something be out of range if i start at the end and work to the front?
View 5 Replies
Dec 15, 2009
I have a variable declared as...
Dim MyList as List(Of String)
I would like to create an array of these lists of string.
Something like....
[code].....
View 14 Replies