How To Setup MyClass To Work Both Ways
May 7, 2010
I'm using VS 2010 so I have auto-implemented properties.I have a class and I want to access the properties by a string.[code]But, I also want to be able to access the variables something like this way.[code]How can I setup MyClass to work both ways?
View 7 Replies
ADVERTISEMENT
May 7, 2010
I can't seem to find the correct words to search for an answer. I'm using VS 2010 so I have auto-implemented properties.I have a class and I want to access the properties by a string.
Public Class MyClass
Property Prop1 As String
Property Prop2 As String[code].....
But, I also want to be able to access the variables something like this way....
Dim MyVar = New MyClass
MyVar.Items("Prop1") = "Prop1 Value"
MyVar.Items("Prop2") = "Prop2 Vaule"
How can I setup MyClass to work both ways?
View 1 Replies
Nov 24, 2010
I have a list of properties and values that i'd like to use to dynamically build an Expression(Of Func(Of MyClass,MyClass))
I can run through the list and create each Expression by itself, but the only way I know how to combine them would be to use Expression.And or Expression.AndAlso, but that returns a BinaryExpression rather than my original Expression(Of Func(Of MyClass,MyClass)).
View 1 Replies
Jun 22, 2010
I've been going through a VB book I had while in College, and was trying to figure out different ways of making programs work.One assignment was to create a multi-dimensional array to figure out wind chill factors. The only part I really can't get to work right is using 2 numericUpDown controls. Using 2 dropdown menus was obviously easy because the items are indexed, but as far as I know, numericUpDown controls are not indexed.
Instead I used 2 selectCase statements to determine the index in each updown control, then passed the indexes to a function to determine the answer.The numericUpDown controls both increment by 5, (wind from 5 to 30) (temp from -20 to 15)Just looking to see if someone has any ideas of a better way of doing this.
[Code]...
View 1 Replies
Dec 2, 2010
In C# .NET 3.5, is there a way to instantiate an object given its string name? For example, suppose I have a DLL (e.g., MyClass.DLL) which contains type MyClass. Is possible to write something like... Object myClass = SomeMethodToInstantiate("MyClass"); // ? Is it possible to do this in VB .NET 3.5?
View 2 Replies
Feb 2, 2011
I have application developed in vb.net 2005 with sql server database and also used crystal report in it. I have make the setup files using deployment wizard. Now the problem is that when I install the setup files, it work on some pcs while didnt run on some others.ramework 2.0 is in its prerequisites which I install before running setup. When I try to see error message, it gives server time out
View 7 Replies
Oct 29, 2009
I have application developed in vb.net 2005 with sql server database and also used crystal report in it. I have make the setup files using deployment wizard. Now the problem is that when I install the setup files, it work on some pcs while didnt run on some others. Framework 2.0 is in its prerequisites which I install before running setup. When I try to see error message, it gives server time out.
View 5 Replies
Jun 10, 2009
The default installation of my setup project is as follows:
[ProgramFilesFolder][Manufacturer][ProductName]
The problem is PC in Europe don't have a "Program Files" folder, it's in a different language.When I remove [ProgramFilesFolder] from the setup program, the installation doesn't work. I would like to install the application in C:AppFolder,
View 1 Replies
May 17, 2011
It's a simple concept, but one I've never been taught
View 1 Replies
Jul 26, 2011
The MyClass keyword behaves like an object variable referring to the current instance of a class as originally implemented. MyClass is similar to Me, but all method calls on it are treated as if the method were NotOverridable. I can see how that could kind of be useful, in some specific scenarios. What I can't think of is, how would you obtain the same behavior in C# - that is, to ensure that a call to a virtual method myMethod is actually invoked against myMethod in the current class, and not a derived myMethod (a.k.a in the IL, invoking call rather than callvirt)?
View 3 Replies
May 17, 2010
In what scenarios would one use the MyBase and MyClass keywords in VB.NET?
View 5 Replies
Nov 3, 2009
i have a code like this
'bug_message is a public shared property
Public Shared Sub bug(ByVal bug_message As String)
msgbox(XX_format(MyClass.bug_message, bug_message))
End Sub
however i get this error: MyClass is valid only within an instance method. I do not wish to use the actual name of my class, and if i could i would prefer to keep the name of the argument as bug_message as well.
View 18 Replies
Sep 14, 2011
Is there a simple way to remove Objects from a List by using a specified value?I add 2 persons to a List, how can now I remove a person by a name without using any Loops? (if possible)
[Code]...
View 3 Replies
Mar 13, 2009
I am trying to use myclass.cs from aspx.vb but receive error "myclass not declared" when I give command:
Imports myclass
View 3 Replies
Oct 6, 2009
I'm getting a: mypage.aspx.vb(390,0): error BC30002:Type 'MyNamespace.MyClass' is not defined when I try to compile, run, etc. my website. What's really odd is that I don't have anything in my Error List before or after I do this. I wouldn't have an idea of what was wrong, except I have my compile verbosity turned way up. The line it's failing on looks like:
[Code]...
View 1 Replies
Mar 16, 2010
Traditionally, class/type name is literally spelled inside its definition.
Public Class MyCustomClass
Public child As MyCustomClass
Public Shared Function Clone(ByVal original As MyCustomClass) As MyCustomClass
End Class
This is not a problem most of the time; C-languages even use class name as constructor methods' name. But consider a generic declaration:
Public Class MyListOfIntegers
Inherits MyCustomList(Of Integer)
End Class
[code]....
This scenario has 2 issues. The first one is that constructors are not inherited, and you have to provide pass-through wrappers in every derived class, — this is quiet dumb, but tolerable. The second issue is more severe: derived class inherits CloneMe() method which returns MyCustomList(Of Integer) , not MyListOfIntegers ! Every returned value must be manually DirectCast 'ed for further use with methods that expect MyListOfIntegers . This issue, together with the first one, renders inheritance of generic class almost useless.
So I need a "MyClass" alternative for static type-binding inside type definition. In case of generic type that is referencing other compound types, task could be accomplished by adding second parameter to type section:
Public Class MyCustomList(Of T, TList)
...
Public Function CloneMe() As TList
[code]....
But since we must reference our own type, it would create an infinite recursive loop of additional typeparamlist arguments. How can this be resolved, aside of creating separate classes without generics?
View 11 Replies
Feb 22, 2011
dim oXT As New Generic.SortedDictionary(Of String, MyClass)
[Code]...
View 4 Replies
May 10, 2012
I want to create a real setup project for my application so when someone want to download it he can run only setup, not default setup that provide me VB . How can I do that?
View 4 Replies
Apr 2, 2009
add serial number requirement to Setup & deployment > setup wizard for VB.net application
View 16 Replies
Feb 14, 2011
I have this code List<string> myList = new List<string>();
myList.AddRange(new MyClass1().Load());
myList.AddRange(new MyClass2().Load());
myList.AddRange(new MyClass3().Load());
myList.DoSomethingWithValues();
What's the best way of running an arbitrary number of Load() methods asynchronously and then ensuring DoSomethingWithValues() runs when all asynchronous threads have completed (of course without incrementing a variable every time a callback happens and waiting for == 3)
View 4 Replies
Jan 15, 2010
I'm trying con build a simple chat client/software (whole in on executable) wich start listen from the start on the port 5900 and when a client connect to that port the chat is established.
The problem is that only the client can chat to the server, the server cannot answer the client because the connection is working in one way.The i've tried to connect from "server" to the client when it establishes a connection but the system crash warning me that the port is already on use.
[Code]...
View 1 Replies
Nov 14, 2011
What is the difference between these ways to delete a file.Is one of the methods better than the other?Are there other ways to delete a file (. Net 4)
System.IO.File.Delete(path
to file)
My.Computer.FileSystem.DeleteFile(path to file)
View 3 Replies
Jan 28, 2009
I'm new to VB and have over the last week or two been looking at the different ways to play audio (mp3's). Windows Media Player, Microsoft Multimedia Control, Bass.dll, SndPlaySound, MCI SendString and DirectX (including audiovideoplayback, direct3d and directsound.) I originally decided to use windows mediaplayer, mainly because it seemed the logical choice but quickly found out I couldn't get it to work properly.
So I installed the Directx SDK but now I'm completely overwhelmed about what to use and why. I need to be able run the compiled code on a win 2k box, play an mp3 from start to finish then load and play another mp3 from start to finish and so on. Whats the difference between the varied choices and which would be the best for me to use?
View 5 Replies
Jun 13, 2011
I want to know by how many different ways I can create an object. The most common usage I am aware about is:
Dim obj as ClassA = new ClassA().
View 1 Replies
Aug 20, 2009
I'm new to VB.NET programming.What I'm confused about is the different ways one can declare a variable.Would someone please explain the difference between the two declarations below? [code]
View 2 Replies
Dec 10, 2009
I'm new to VB and have over the last week or two been looking at the different ways to play audio (mp3's). Windows Media Player, Microsoft Multimedia Control, Bass.dll, SndPlaySound, MCI SendString and DirectX (including audiovideoplayback, direct3d and directsound.)I origninally decided to use windows mediaplayer, mainly because it seemed the logical choice but quickly found out i couldn't get it to work properly. So i installed the Directx SDK but now i'm completely overwhelmed about what to use and why.
View 3 Replies
Jul 14, 2009
What are the different ways to send the emails using vb.net?
View 4 Replies
May 4, 2010
I'm looking at creating an mp3 player to keep myself busy. However I'm trying everything I can to avoid using the windows media player COM component. It makes it a little too easyWhile looking around I stumbled upon the DirectX.AudioVideoPlayback namespace and I was wondering if this would be sufficient. Would I be able to create an equalizer and other more advanced things for my application?
View 2 Replies
Jun 20, 2012
Just found out the hardway that there is no longer support for Direcshow for VB.net and C#. Does anyone know other ways of playing mp3s in VB.net, or even video for that matter?
View 9 Replies
Jun 29, 2006
I am trying to create a bunch of records, there will be a limited number of "Codes", about 50. Each "Code" is associated with a name from a textbox, I was trying to have it save each one when you click a button, to a .txt file.So, from the start the record will be blank, the person will go through the form, choose a number from a numerical up and down box, pick a name associated with it (both of these are mandatory and not implied). When they click the button, it will save the contents I talked about into a .txt file, say the number is #2, and the name is "Bob", the next time they try to change that value for #2, it will overwrite "Bob".
View 6 Replies