473,396 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Is Button also alias name

Hi,

the following code works fine:

Type t = Type.GetType( "System.Int32" );

Whats wrong with this one:

Type t = Type.GetType( "System.Windows.Forms.Button" );
- Kimmo Laine
Nov 15 '05 #1
1 1016
Kimmo,
the following code works fine:

Type t = Type.GetType( "System.Int32" );

Whats wrong with this one:

Type t = Type.GetType( "System.Windows.Forms.Button" );


When you specify only a type name, Type.GetType only searches the
calling assembly and Mscorlib. Since Int32 is implemented in Mscorlib
it finds that, but not Button which is in the System.Windows.Forms
assembly.

The solution is to either specify the full type and assembly name

Type.GetType( "System.Windows.Forms.Button, System.Windows.Forms, " +
"Version=1.0.5000.0, Culture=neutral, " +
"PublicKeyToken=b77a5c561934e089, Custom=null" );

or get an System.Reflection.Assembly reference for the
System.Windows.Forms assembly and call GetType on that, or (if you
have System.Windows.Forms.dll referenced) use C#'s typeof() operator.

typeof(System.Windows.Forms.Button)

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Paul A. Wilson | last post by:
I'm new to Tkinter programming and am having trouble creating a reusable button bar... I want to be able to feed my class a dictionary of button names and function names, which the class will make....
5
by: Santiago Ordax Solivellas | last post by:
Hi. We have almost all our tables defined on library lib1 and some on lib2. We have alias defined on lib1 to access tables on lib2 so there is no need to qualify library name. Alias for tables on...
6
by: Mark | last post by:
Hi All, Does anyone know of a way that I can get a task bar button to flash if a form is open? I have created something like a messenger application within my database but there are a few people...
2
by: hemong | last post by:
Hi, wondering if anyone can help me I have created a form and user id, password that allows the user to submit and all this works fine however I want to create another button next to the ' > '...
3
by: Jake G | last post by:
Hi, I have elements my page with an "alias" in them e.g. <input type=hidden id="S_SELLOG" name="S_SELLOG" iegAlias="S_SELLOG01" maxlength=1 title="Login/Logout" style="top:0; left:0;"> I am...
1
by: dwasler | last post by:
Try every thing I know to remove this alias I know there been other posting I read each one none seem to work. Thank You DLWasler dwasler@yahoo.com OS Window db2 V 8.2.X
17
by: DeZZar | last post by:
Hi all, I need to regularly backup my database as an Excel file and have been using the File Export option. Problem is I need anyone using the database to be able to do this easily - nopt...
5
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
1
by: alnino | last post by:
Hi, On a form I have a command button that allows a user to browse for a file (PDF, Word, etc…). This command button then stores a hyperlink to the file within an associated txtfield in the table....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
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,...
0
jinu1996
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.