Hi!
I want to write C# code by which I can determine the name of an object
and/or variable at run-time.
VS design windows does it when you drag a control onto your form. It uses
the name of the control's type and adds a number to it and creates a name for
the object, like "button2".
Regards
M Shafaat 3 1162
Do you mean the name of the type of the object? objects don't have names
Regards
Richard Blewett - DevelopMentor http://www.dotnetconsult.co.uk/weblog http://www.dotnetconsult.co.uk
Hi!
I want to write C# code by which I can determine the name of an object
and/or variable at run-time.
VS design windows does it when you drag a control onto your form. It uses
the name of the control's type and adds a number to it and creates a name for
the object, like "button2".
Regards
M Shafaat
Hi,
If the object is derived from Control ( like textbox, combobox, etc ) you
can use Control.Name ,
what is what you want to do anyway?
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"M Shafaat" <M Sh*****@discuss ions.microsoft. com> wrote in message
news:5E******** *************** ***********@mic rosoft.com... Hi! I want to write C# code by which I can determine the name of an object and/or variable at run-time.
VS design windows does it when you drag a control onto your form. It uses the name of the control's type and adds a number to it and creates a name for the object, like "button2".
Regards M Shafaat
Well, sorry I expressed badly what I want to do.
By "name", I mean "identifier ".
Regards
M Shafaat
"Ignacio Machin ( .NET/ C# MVP )" wrote: Hi,
If the object is derived from Control ( like textbox, combobox, etc ) you can use Control.Name ,
what is what you want to do anyway?
cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
"M Shafaat" <M Sh*****@discuss ions.microsoft. com> wrote in message news:5E******** *************** ***********@mic rosoft.com... Hi! I want to write C# code by which I can determine the name of an object and/or variable at run-time.
VS design windows does it when you drag a control onto your form. It uses the name of the control's type and adds a number to it and creates a name for the object, like "button2".
Regards M Shafaat This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Mark Fisher |
last post by:
I have a Java desktop GUI application that the user can run multiple
times. In order to keep one instance of the application distinct from
another, I'd like to put the instance number of the application in the
title bar.
For example, the user starts the application, and the title bar says
"Control Panel". The user starts another instance of the application,
and it knows that one instance is already running, so the title bar of
the...
|
by: Christopher W. Douglas |
last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a
method that handles several events, such as closing a form and changing the
visible status of a form. I have some code that applies to all these
events, but I need to have specific code execute when the form closes. The
properties for this method are sender (the originator) and e (event
arguments). I know how to get typeof (sender) to determine what form or...
|
by: mikeorb |
last post by:
Is there a way to determine the object that a property is in? For
example:
function MyClass() { ... }
MyClass.prototype.myFunc = function() { ... }
var obj = new MyClass();
var sameobj = SOMEFUNCTION(obj.myFunc);
So my goal is to get a reference to the object by just having the
|
by: Lance |
last post by:
Is there any way to determine the full name of an object at runtime? For example, if I have the following
Namespace MyNameSpac
Public Class MyClas
Protected MyObject As Object 'This could be any type
End Clas
End Namespac
then I want a function that would return the string, "RootNamespace.MyNameSpace.MyClass.MyObject" if I passed MyObject to the function, where RootNamespace is the root namespace for the project
|
by: Doru Roman |
last post by:
Hi,
What is the fastest way to evaluate manually the result in this case:
int a, b, c;
a = 255;
b = 122;
c = a & b;
The only way I know is transforming each number into the binary value and
| |
by: MLH |
last post by:
Suppose MyName, a string variable
equals "frmEnterClients". How can I
determine ...
1) if frmEnterClients exists as an object in the database?
2) what type of object is it (tbl, qry, frm, rpt, mac, mod)?
|
by: Developer in California |
last post by:
I am working on developing a generic Web framework using Master Pages in
ASP.NET 2.0. What I have done is created a PageRenderer class which has a
public method which will retrieve the path of the content I want to execute
based on the name of the asp:Content control. As shown in the code snippet
below, to get the content I want to display, I call the GetContentPagePath
public method in PageRenderer passing a string duplicating the value...
|
by: Ole |
last post by:
If I define a class and create a instant of it like e.g.:
UserClass instantName = new UserClass();
how do I then determine the defined name "instantName" in the UserClass e.g.
in a method (or a property) like this:
public void userFunction()
{
string Var = new string();
|
by: softwaredoug |
last post by:
I can't see to easily find this on google or in a newsgroup
Is there a standard function/macro/whatever you can call and determine
the distance in a C program how deep one is in the C call stack from
main.
Something along the lines:
int main()
{
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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: 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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
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...
| |