Hi,
i've got a little question.
I'd like to create an object for example TextBox
normaly it'd like look like this:
TextBox my_Object = new TextBox();
but i'd like to get the name of the instance from a string.
string name = "my_object_name _from_string";
TextBox name = new TextBox();
any ideas how to do such a thing ? is it possible ?? 5 2420
Grisha,
You make me curious, what is the sense of your question.
You can give your textbox an external name setting the "text" property to a
string, however what is the sense giving a textbox an internal name from a
string, which will never be seen by a user.
Just curious, because you must have a reason.
Cor
"Grisha0" <gr*****@o2.p l> i've got a little question. I'd like to create an object for example TextBox normaly it'd like look like this: TextBox my_Object = new TextBox();
but i'd like to get the name of the instance from a string.
string name = "my_object_name _from_string"; TextBox name = new TextBox();
any ideas how to do such a thing ? is it possible ??
i'm trying to create an interface stored in a database in form of strings.
a client application is connecting to the DB.
Getting information (strings) about interface.
with this information is is creating whole interface :D
so the someobject.name is not enough ... i can do it this way but it
will look stupid and i don't like it :]
i'd like to get a string from db like
'TextBox/my_textbox/100/20'
and with such info create
one object of TextBox class
with usable in further programing name of my_textbox.
using it like my_textbox.text = 'blah blah blah';
and parameters ... width 100
height 20
Cor Ligthert wrote: Grisha,
You make me curious, what is the sense of your question. You can give your textbox an external name setting the "text" property to a string, however what is the sense giving a textbox an internal name from a string, which will never be seen by a user.
Just curious, because you must have a reason.
Cor
"Grisha0" <gr*****@o2.p l>
i've got a little question. I'd like to create an object for example TextBox normaly it'd like look like this: TextBox my_Object = new TextBox();
but i'd like to get the name of the instance from a string.
string name = "my_object_name _from_string"; TextBox name = new TextBox();
any ideas how to do such a thing ? is it possible ??
Grisha,
With dynamicly creating an array of controls, you keep having early binding,
for that you can use an array too the indexes, by instance an hashtable, in
my opinion much more efficient than trying to create an object directly from
a string.
However just my thought,
Cor
could you give me an example.
Cor Ligthert wrote: Grisha,
With dynamicly creating an array of controls, you keep having early binding, for that you can use an array too the indexes, by instance an hashtable, in my opinion much more efficient than trying to create an object directly from a string.
However just my thought,
Cor
Grisha, could you give me an example.
No, I dont have that, and I see no reason to make that.
I am not creating a substitute for ms-access.
Cor This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Doug |
last post by:
I am attempting to create a unit test that can switch between calling
a method from the web service I created or calling the component that
the web service actually calls.
So in my unit test form I have a checkbox that I can use to "turn on
or off" which one I would call and I have code something like this:
if (chkUseWs.Checked == true)
{
WebReference.WebClass o = new WebReference.WebClass();
|
by: DraguVaso |
last post by:
Hi,
In my application, on some given actions while debugging in Visual Studio, I
suddenly get a "System.ComponentModel.Win32Exception was unhandled"
Message="Error creating window handle." exception.
The problem is that this exception isn't raised somewhere in a method, so it
just shows up, and it causes the application to shut down.
Is there anyway how to catch this kinds of exceptions? Can I put somewhere a
|
by: Dixie |
last post by:
I wish to add some fields to an existing table in code.
I am using the following code from rkc.
CurrentDb.Execute ("ALTER TABLE MyTable ADD MyNewField Text 25")
This works , but I need to also set the Required, Allow Zero Length and
Indexed attributes. I have tried but keep getting a syntax error.
Also, can I set the default value of a field in code?
Has anyone some examples of these.
TIA
|
by: Carlos Lozano |
last post by:
Hi,
What is the right way to create an OCX COM component. The component is
already registerred, but can't create an instance. I am using the reference
to the interop module created.
If I use javascript or vbscript it works.
I will appreciate any help.
I do the following (C#):
|
by: |
last post by:
Trying to learn about manipulating collections of objects, and populating
these objects dynamically from datasources. Could someone post a code sample
that shows the following:
Instantiating a collection object -- say, a dictionary.
Populating that collection object with custom objects, say, Person. What I
really want to see is how to populate the properties of those Person objects
from a datasource: instantiate one Person, fill...
| |
by: Simon Verona |
last post by:
I would normally use code such as :
Dim Customer as new Customer
Dim t as new threading.thread(AddressOf Customer.DisplayCustomer)
Customer.CustomerId=MyCustomerId
t.start
Which would create a new thread to display a customer on the screen for example.
However, I have a problem with circular references in my objects which means that I have to load the customer object using reflection ie :
|
by: Michael K. Walter |
last post by:
I'd like to create a strongly-typed collection of objects that are indexed
by a string value (key is a string). I'd also like to allow users to iterate
over the collection using a For-each loop where an object of the contained
type is returned (instead of just the standard DictionaryEntry object).
- only allow objects of type MyObj to be added to the collection
- return a MyObj type in the For-each loop
What's the best way to do this?
|
by: tshad |
last post by:
This is a little complicated to explain but I have some web services on a
machine that work great.
The problem is that I have run into a situation where I need to set up my
program to access one or another (could also be 3) different web servers to
use these Web Services. The Web Services are identical on all the machines.
I tried just changing the URL of the Web Services and cannot make it work.
I then decided to create 2 identical web...
|
by: tshad |
last post by:
I am trying to set up an Image authorization where you type in the value
that is in a picture to log on to our site.
I found a program that is supposed to do it, but it doesn't seem to work.
It should put a blue and yellow box on the page with "This is a test" as
part of the picture. But what I get is a broken Gif.
The other problem is that I can't view the source???? The view source is
disabled for this page. What causes this?
|
by: austincolby |
last post by:
I am working on creating a SOAP client in Visual Studio 2008 for the first time but am running into a few issues. I added the Web Service reference to the project and am able to see the namespace and set the information for the classes but cannot figure out how to send the information to the server or receive a response. Below is my code and any help is appreciated!
Imports Microsoft.Web.Services2
Public Class Form1
Public...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |