I am trying to select all the pictureboxs in a flowlayoutpanel control with a for each loop but what should i use as the parent? this is the
For Each Pic as PictureBox in FlowlayoutPannel1 It says that Flowlayout pannel is not a collection but i do not know what to use and the other threads that i read did not make any sense
im trying to make a program that consists of two forms.One 'toolbox' form, and one 'pallet' form. The toolbox has components that you drag onto the pallet form. Once you drag them onto the pallet form, you should be able to move around the pictureboxes. Unfortunatley, since they are dynamic controls, i have no way of checking what picturebox you click on when there are multiple pictureboxes on the pallet at one time. they are in an arraylist, however i dont know how to check on my mouse_down routine what array index the picturebox is.
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?
I have been researching for a couple of days now and to no avail. Does Anyone know how to make a custom collection that take advantage of the collection editor? I would like to be able to have 3 Color Values, 1 Boolean and 1 String.
I'm trying to support Basic.NET on my framework so I'm trying to convert C# 4 code to Basic.NET 10. Microsoft is committed to "co-evolve" these two but I'm having a problem with collection initialization... I found that I can initialize a collection much like in C#:
I've got the following ADO.NET Entity Framework Entity Data Model:I want to find all the Policyholders with both a Service of a given Id and also a Keyword of a given Status.
This LINQ Does Not Work:
Dim ServicesId As Integer = ... Dim KeywordStatus As Integer = ... Dim FoundPolicyholders = From p As Policyholder In db.PolicyholderSet.Include("Keywords").Include("Services") _ Where p.Services.Id = ServicesId _ And p.Keywords.Status = KeywordStatus _ Select p
The Where clause cannot search the p.Services and p.Keywords EntityCollections in that way.
currently in my application I have a Global Collection that is a Collection of Collections.Currently I am trying to add items/ elements to one of the child collections of the Global Collection but I am unable to use the collections methods of the child.When I assign a variable to the child collection and return the collection it is just an object with the collection inside.
Ex: Dim GlobalCollection as New Collection Dim ChildCollection1 as New Collection Dim tempCurrentCollection[code]......
I've been working with a CMS called InsiteCreations 2008. I'm running into an error I just can't wrap my head around. I would even be willing to compensate anyone a small amount over paypal, for a solution. The error is rare in occurance, and appears when clicking about 3-4% of links to other pages within our CMS.The full code page is quite large, but there seems to be only one function associated with the error. The error also only appears when not logged into the CMS. If logged into the CMS, clicking the link simply displays the page as normal. I have already checked permissions on the page from the CMS admin console, and it is public.
The error message is as follows:
Server Error in '/' Application.Collection index must be in the range 1 to the size of the collection. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
How can I empty a collection in .NET? Let me specify that I don't want to destroy the collection , I just don't want it to have the objects it had before (so I can refill it from scratch) .
I have a simple control called DipSwitch. It consists of a PictureBox and an ImageList. Here is the[code...]
If I create an instance of the Port, I can add DipSwitches to the Collection through the interface. But they do not show up on the form. Likewise, after adding DipSwitches through the interface, if I try and add more, the original ones disappear, although they remain defined in the Designer module.
How can I empty a collection in VB .NET ? Let me specify that I don't want to destroy the collection , I just don't want it to have the objects it had before (so I can refill it from scratch) .
I know you are going to lough about this , but I guess I deserve it ...I am sure I am doing something wrong , but I can't find it out ...I have created a collection , lets sayMyCollectionI have also created a class , lets call itMyClass
I am trying to add the file information of the contents of a folder to a collection. Although I am getting the collection to hold the correct number of items that the folder contains, all of the collection's items are the details of the last file in the folder.
I'm trying to use a loop to go through each item contained in the folder and then adding the item details to a collection with the following line
nCounter += 1 collFileDetails.Add(NameOfItem, nCounter) Next NameOfItem
I want to display a list of open windows on my computer in a rich text box. So, I'm trying to store the names of all windows in myString, and then set RichTextBox1.Text = myString.
Here's the code
Imports System Imports System.Collections.Generic Imports System.Collections.ObjectModel
I want to take a field from a table and place the content into a collection. The collection is not supposed to have any duplicates. This is my code sofar... It does not work. The NOT statement is supposed to only enter values into the collection, when the collection does not allready contain the matching string.
Does anyone know how I can access the FontDialog's controls collection? I would like to disable the Font Style ListBox, set the Font Style's TextBox to readonly and disable the UnderLine and StrikeOut CheckBoxes.
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.
vb.net Dim testStr As String = "<option value=""18621335"">graham23s</option>" Dim rx As New Regex("<option value=""(d+)"">(.+?)</option>")
[code]....
When i put it into my own application i have done:
vb.net Dim stringSource As New Regex("<optionvalue=""(d+)"">(.+?)</option>", RegexOptions.IgnoreCase Or RegexOptions.Singleline) Dim stringMatches As MatchCollection = stringSource.Matches(stringCle
[code]....
what i am having trouble with is getting the values while in the foreach loop.
using a Binding Source to Bind my Collection to a ListBox? I can bind the class to the binding source, but im not sure how to let it know what type of list it is, or how to display the correct item.
I'm trying to get the listbox to display the ItemNames. Here's my class and collection class.
<System.Serializable()> Public Class SurveyItem Private itemNm As String Property ItemName() As String
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
Using vb.net 2008 Forms. I have a groupbox consisting of several textbox's and a push button. I put this groupbox in a control collection in order to validate each texbox when the push button is clicked.
The code to do this is as follows: Private Sub bn_updateadditem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bn_updateadditem.Click Dim InvalidInput As Boolean = False Controls.AddRange(New System.Windows.Forms.Control() {Me.GroupBox1}) Dim ctrl As Control For Each ctrl In Controls [Code] .....
This worked great. However when I moved this groupbox with all its controls onto a tab, the groupbox contents disappeared from the form after the control collection is created and contents validated (per above code).
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
Public Class Store Public Overridable Property Areas As List(Of Area) End Class Public Class Area
[code]....
What's the quickest way to get a total count of shelves for a store? I.e. for a store I get the total count of areas by using Areas.Count Or will I need to loop through each area and tally the count of shelves?