bridobony April 20, 2010 at 14:35:45 Specs: Windows 7
I have a string that contains an object name, and want to use that string to reference that object that it contains. Is there a way to do this. For example if you have an multiple objects and one of them is davidimagelist and another is joelimagelist. Then you have a string that contains "joelimagelist". Is there a way you can use the string to be as the object to which is equal to what it contains.
I am looking for a way to do this in vb.net. The logic that you have given may help me out though. I am not sure the language you are using (looks like C#). If you know how to do this in the Visual Basic language please let me know.
i tested that in visual basic 3.2, but i know there's lots of differences between .net and older veebees. the "scripting.filesystemobject" was just a convenient object for me to use. i works equally well with, f/e: "excel.application".
Still have not been able to do it. The reason for doing so is that I have a program that I want to be able to add information quickly without having to add more code. I have a imagelist that contains different pictures of characthers with each picture filename named as the name. This name is then set as a string with the extention trimmed off. Then I am trying to use the name to correspond with another imagelist having the imagelist name being the same as the string. Right now I have gotten the program to work but I have to add the character in code when I add new characters. If I can get the value of the string varable to reference the imagelist that has the same name as the string contained in the variable this would make adding characters easy without adding more code.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Purch hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.