473,226 Members | 1,683 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,226 software developers and data experts.

ListViewItem and ListViewSubItem

Hi,

I have some problem. I try to get ListViewSubItem type using:

Type t = (new
Form).GetType().Assembly.GetType("System.Windows.F orms.ListViewItem.ListViewSubItem")

but I get t == null. I notice that I can do that using:

Type t = (new
Form).GetType().Assembly.GetType("System.Windows.F orms.ListViewItem
+ListViewSubItem")

Why I have to use "+" sign in namespace? What does it mean? Whay in
msdn is ListViewItem.ListViewSubItem not ListViewItem+ListViewSubItem?

Best regards,
Klaudiusz
Aug 1 '08 #1
3 3767
On Fri, 01 Aug 2008 05:07:30 -0700, Klaudiusz Bryja
<br*************@poczta.fmwrote:
I have some problem. I try to get ListViewSubItem type using:

Type t = (new
Form).GetType().Assembly.GetType("System.Windows.F orms.ListViewItem.ListViewSubItem")

but I get t == null.
What are you _really_ trying to do? That is, why do you even want the
type?

As far as your question goes, it seems to me that the most
straight-forward fix is to not use Assembly.GetType() at all. Just use
the "typeof" operator:

Type t = typeof(ListViewSubItem);

Pete
Aug 1 '08 #2
+ is the token used internally to indicate nested classes, rather than
classes within a namespace. However, there is no need to use strings here:

Type type = typeof(System.Windows.Forms.ListViewItem.ListViewS ubItem);

Marc
Aug 1 '08 #3
On Aug 1, 4:07*pm, Klaudiusz Bryja <bryja_klaudi...@poczta.fmwrote:
Why I have to use "+" sign in namespace? What does it mean? Whay in
msdn is ListViewItem.ListViewSubItem not ListViewItem+ListViewSubItem?
"+" is a reflection-specific way of denoting nested classes. In C# you
can use "." because the compiler handles this for you; however, this
means that in C#, you cannot have a namespace that contains another
namespace and a class with the same name (CLS forbids this as well, by
the way). CLR itself does not restrict such a thing, however, so you
can write it in IL and compile using ilasm, for example, and
reflection should be able to handle any valid CLR assembly, whether it
is generated by C# or something else, and whether it is CLS-compliant
or not, so it had to make this explicit.
Aug 1 '08 #4

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

Similar topics

0
by: LV | last post by:
Hello, I would like to manually set one of my list view items as selected. When this item is set, I would like for a method to execute. I have a delegate on the list view for SelectedIndexChanged....
6
by: grs | last post by:
The following is a code example from the Microsoft MSDN. My question is on the following three lines of code: ListViewItem item1 = new ListViewItem("item1",0); ListViewItem item2 = new...
0
by: Kluch | last post by:
I am trying to select and focus single ListViewItem and can't seem to do so, here is my code: IEnumerator * itemList = mLsvMyList->Items->GetEnumerator(); while (itemList->MoveNext()) {...
1
by: Laurence Bunnage | last post by:
Has anyone come across the following problem and does anybody know of a solution. I am using a ListView to display the age of a collection of items. When the items are an hour old, I am using...
1
by: Alan T | last post by:
I have a listview defined a coloumn at design time. And the code I use to add a listviewitem: ListViewItem lvi = new ListViewItem(user.Name); lvi.Tag = (Object)user.Id; ...
2
by: Kela | last post by:
An interesting problem: I have a ListView with LabelEdit set to TRUE. When I change the label, I want to make some decisions as to whether the ListViewItem (that's just been edited) should stay in...
0
by: garyusenet | last post by:
I am trying to create a form that will display a list of open internet explorer windows and allow the user to choose one of them. So far I have created an arraylist which contains all of the open...
13
by: deciacco | last post by:
How can I have access to the items collection of a listview control on my form from a background thread? I know I need delegates to update the listview control and I have those calls in the...
10
by: Gav | last post by:
I am trying to have a ListView to dispay a list of names and want to have an id stored within the list but not visable. I have tried to go about doing this by using the ListViewItem and setting...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.