Private GetCapacity As Integer
GetCounter As Integer
Private GetPosition As TV3D65.TV_3DVECTOR
'Make ".Property"'s called capacity, outofammo, etc..
Property Capacity As Integer
I followed up on Cor's comment about turning fields into properties in Visual Basic 2008 Express and have hit another road block.In the following Class declarations, ASet.Integrity is meant to be dependent on the set of AFolder.Integrity values.As an example, when Getting ASet.Integrity, it is true only if every AFolder.Integrity is true.At the two points marked by xxxxx, I am trying to code this relationship, and expected to be able to make use of "AFolder.Integrity" but the IDE will not recognise this input. I have tried all sorts of flavours of declarations of Afolder within ASet and within the FolderList declaration, as well as instantiations of AFolder and FolderList
Public Class ASet Private m_Hash As String Private m_Type As Byte
Interface makes sure a class does have a Method / Property, However is there a way to create an unInterface, making sure that the class does not have a method / property or is there a way to implement something that will unimplement every other implements except for itself?
what i want to do: i've got a class that serves as a storage for information only, so i decided to give it a blank interface IBank, the other classes that share this feature will implement this interface. they should not implement any other interface the use is that when i seek out the interface of a class and realise that its IBank i know that its just a class for info storage.
I have 2 arrays, tile(13,6) and loc1tile(13,6). Is there a way to make the values in loc1tile(13,6) equal to the corresponding values of tile(13,6)?Do I have to do it like this?
I want to set a property of an object that is an array type. If I was declaring and initialising an array of objects, I'd do this: Dim x() as SomeObject = {obj1, obj2}
I don't seems to be able to do something similar with the property, can you do this, does anyone know the correct syntax? myObj.ArrayProperty = {obj1, obj2}
I get Expression Expected Error on the first {
Infer Off Explicit On Strict On
Answer : myObj.ArrayProperty = New objType() {obj1, obj2}
I was wondering if it was possible to make an array of a class. I made a class called creatures (for a game of course) and wanted to make an array of that class. So I tried "public creature() as new creatures", and it had a problem with using an array with new. Is there a way around this. All I am using the class for is variables. i.e.: in my class all i have is dim health, defense
I'm trying to create a property that will allow the setting of a last name based on a variety of inputs. The code that calls this is parsing a name field.In some instances it will have a single last name, in others, a array of last names that need to be concatenated. I want to keep my concatenation code in a single place to make maintenance easier.[code]I've tried numerous variations on this, even putting multiple Set in the same Property, but nothing seems to work. There must be some way to take in an array and a single instance value. The compiler clearly knows if the incoming object is an array or not.I tried working with just a property of type String(), but then I can't return a String. The only solution that I can think of is differently named properties, which makes using the class more difficult, or a whole bunch of Subs and Functions overloading each other.
I need to make an array of images using references to the resources folder. The following is my code which does not work: Dim imgPictures(8) As Image imgPictures(0) = Image.FromFile(My.Resources.cat_1.ToString) How do I reference the images sitting in the resources folder for this task?
Im making a class that represents a file. Im making a sub that reads data from one byte array into many properties. Now i need something that returns a byte array but only the first 4. Let me demonstrate because i can't think of a logical way of explaining. "something".substring(0,3) That would return a string containing "som" i need a function like that for a byte array
[code]...
Is there an existing function for this type of thing ? i've looked but didn't see anything that I understood.
Stack Overflowers:I have been racking my brain trying to get an List(of T) type array to be the property of a class. I know there has to be a simple way of doing it and I can't find a good example on google. Everytime I create a class that I think will work I get the "Object reference not set to an instance of an object" error when I try to use it. My thinking now is that I cannot use it in the way I was hoping to. Here is my latest attempt:
Public Class Item Private _itemno As String Public Property ItemNo() As String Get
I/we (my class) created a usercontrol that included a picturebox and a timer. We declared the public variable to access the timer enabled property. Placing the user control onto a Form we are able to enable the timer. However, when we went to declare an array for the control we could not access the properties... We successfully declared control arrays using base class control...
I have two forms, an mdi parent and an mdi child. Each instance of the mdi child has an array of graphicspaths. I create the first instance of the mdi child form and add several graphicspaths to the array. I create another instance of the mdi child form and add several different graphicspaths to that array.
If you have a Component (or Control) with a public property of type Control, then in the Properties Window you automatically get a drop down of all the controls on the same form as the component, which is very handy. If you want to do the same thing but with an array of controls then the Properties Window shows the ellipsis and you get the Collection Editor with the Add / Remove buttons creating and deleting an instance of Control (i.e. the base class used for deriving all the others) - not quite so handy.
How do I get a list of the controls on a form and be able to select more than one? I think I need to create a custom UITypeEditor? Assuming that's right then I think I need a dialog box (like the Font dialog) with Available and Selected ListBoxes with Add / Remove buttons and appropriate code to link the control array in the component to changes in the Selected list box? Along with an appropriate UITypeEditor derived class.
Assuming that's correct, how do you get a list of the controls on a form at design time? Can I do that form design as a Windows Form, just as normal, or is it all done by hand? I've seen some code that does it with a UserControl rather than a Form, presumably that's for when you want a 'pop-up' control (like the one for Color selection)?
I am currently learning VB.net but for a project I need to create and array and pass it using a property. The data to be passed will be a train's destination, the time its due and the expected time of the train. I was wondering if someone could simplly explain how to first produce an array and then show how to pass it to a custom control
I need to define a property in my class which is an array (of doubles).My original (bad) version is this:
Public Class Market Property Correlations0 As Double Property Correlations1 As Double Property Correlations2 As Double
[code].....
This however doesn't work. I get an error already at design time: "Public Property Correlations as Double has no parameters and its return type cannot be indexed."What should I do with it? I also do not know in advance how large the array should be (the array size is determined at runtime based on other properties).
I have 50 textboxes, for i = 1 to 50 textbox(i)="This is " & i Next i This is very simple. But I cannot put textboxes on FORM1. How can I array (index) them on FORM1 (in Property Window)?
I have an array of textboxes. Lets say this one:[code]What i want to do is set the .Text property for each of the textboxes of the array.I have tried this: [code]
So if I create an object test, and it has a property color. When I add this object to an array list I typically can access this using myarray(0).color but intellisense doesn't 'know' that I have a 'test' object inside the array. It would let me type myarray(0).whatever but would then crash if I made typo. It seems like I should be able to let it know what type of object I am trying to work with inside the arraylist. In code maybe something like this
Any hunk of code that loops trough the windows form controls array, and based on top/left to bottom/right, resets the TabIndex property? I've mashed a huge form together and expect my user community to want to move things around, and I don't want to have to fool around with this over and over again.
I am writing an app to be a single button failover of a set of mirrored SQL servers. The app has to handle several other functions (enable/disable and start/stop of services, writing to local registry, copying files from server A to server B, initiating stored procedures, etc.)I have a collection of labels that indicate the status of 4 services on 2 servers, I wrote a function to check the services when passed the machine name, and the service name. Originally I just called the function 8 times (4 services, 2 machines) and populated the labels 'manually'. I have all of this within a timer so that the service status is refreshed every couple seconds. Id like to clean up the code to a single for/next loop that operates on 2 arrays (an array of service names, and an array of labels) such as:
'**Fetch_Status is the function that gets service status, it accepts 2 strings, machine name '**and service name and returns status "running", "Stopped", as my_status Dim Services() As String = {"Service1", "Service2", "Service3", etc.}
[code]....
The only reason I want the control array is to be able to use the .Text and .BackColor properties of the labels in the loop. If I make an array of strings with the label names it doesnt seem to pick that up.