|
When you create your ListViewItem object, the string you pass as a parameter is what will be displayed in the first column.
For example
<br />
ListViewItem item = new ListViewItem("Text that will be displayed in the first column");<br />
item.SubItem.add("Text that will be displayed in the second column");<br />
Hope this helps
Hugo Migneron
|
|
|
|
|
We can pass a ListViewItem to the items.add methods of the ListView, I can't pass a string since a need to put object into the listview.
Well.. later
|
|
|
|
|
I am not sure i understand correctly what you are saying, can you post your code?
Hugo Migneron
|
|
|
|
|
lstServerExplorer.Items.Clear();<br />
foreach( XmlNode node in xn)<br />
{<br />
strProvider = node.ChildNodes[0].InnerText.ToString();<br />
strServer = node.ChildNodes[1].InnerText.ToString();<br />
strDatabase = node.ChildNodes[2].InnerText.ToString();<br />
strUser = node.ChildNodes[3].InnerText.ToString();<br />
strPassword = node.ChildNodes[4].InnerText.ToString();<br />
itm = new ConnectionItem(strProvider, strServer, strDatabase, strUser, strPassword);<br />
lstServerExplorer.Items.Add(itm);<br />
}
Where itm is an instance of a class that inherits from ListViewItem.
Well.. later
|
|
|
|
|
I would say you should call the base ListViewItem constructor in the ConnectionItem consctuctor.
public ConnectionItem(strProvider, strServer, strDatabase, strUser, strPassword):base([whatever you want to display in your first column])
Hope this helps!
Hugo Migneron
|
|
|
|
|
You helped me find the solution. I have used base.Text and it finnally work, thank you so much.;)
Well.. later
|
|
|
|
|
I have a small app that I run on the files in the directory (pulls strings out of .resx files). I want to add a param to that app to do the sub dirs. How can I get all .resx files from the sub directories given a root directory? My guess is to use the Directory.GetDirectories but I bet I have to do it recursively right? Simpler way of doing it?
Any code samples?
Thanks
Darren
|
|
|
|
|
Anonymous wrote:
My guess is to use the Directory.GetDirectories but I bet I have to do it recursively right? Simpler way of doing it?
That is the simpler way of doing it. Write a function that takes a path as a parameter. This function will process all the files in that path. Then, it gets the list of subdirectories in that path and, one-by-one, calls itself with the new paths from that list.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
how can i make the first letter of a string uppercase and the rest lowercase?
Thanks
|
|
|
|
|
Hi,
i think the following method will be one option:
Divide the string with the substring-method into two pieces and use ToUpper() for the first part and ToLower() for the second one:
<br />
string s = "SOMETHING";<br />
s = s.Substring(0,1).ToUpper() + s.Substring(1, s.Length - 1).ToLower();<br />
Before you execute this, you must be sure that the string has at least one character.
Hope, this helps you
Sebastian Martens
|
|
|
|
|
Which CIM object contains information about the current loged-in user?
Thank u for the answers!
|
|
|
|
|
THe class is Win32_LogonSession[^], but it only works on Windows XP or above. It won't work on Windows 2000/NT/9x.
[EDIT]
Oops! Forgot the second one, Win32_LoggedOnUser[^]. But the same restrictions apply, XP and above only.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Don't you(or anybody) know enythig else working under XP too?
|
|
|
|
|
Using WMI, there isn't one. There 2 ways around this:
1. To write a service, installed and running on the client, that uses Win32 API function to get the same information and reports it back to a server application, either actively when anyone logs on, or when the server application poles the machine for it.
2. Write your own WMI class that provides this information and deploy it to all your clients. (Much more difficult because of a smaller documentation and example base)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can I compile forms in a separate DLLs to make it easy to update single forms?
Any other solutions other than DLL files?
|
|
|
|
|
|
Look at the articles about Plugins on this site, they should give you ideas
Example[^]
Gary
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'
- Dilbert
|
|
|
|
|
Hi everyone,
I have a form that has a lot of controls in it. While it is loading, controls appear one after another, giving my app an unprofessional look.
Is there any way to prevent updating my form until it is completely loaded?
Thanks
|
|
|
|
|
I don't know if I understood your question correctly, as I never saw this behavior happening (and I have some test machines that are old and slow) - it may be because you're creating dynamic controls. If this is the case, you could try using SuspendLayout/ResumeLayout (if your problem is the slow layout manager) or try sending a WM_SETREDRAW message to your form to prevent it redrawing while you're updating it.
Some controls also support the BeginUpdate()/EndUpdate() while you load data to them, e.g., the ListView, ListBox, TreeView, etc.
Yes, even I am blogging now!
|
|
|
|
|
Thanks for your reply. You got it correctly, and yes, I am creating dynamic controls, and they are not standard, but third party.
I know about the BeginUpdate and such of the treeview, thats what I was looking for, but applied to a form.
I'll try your suggestions, thanks for the info
|
|
|
|
|
Ok, I am using the .NET provided threadpool for an app that is doing a lot of things. Well, my poblem, I am trying to determine at any given point in time how many threads this application is spawning. The best I can think of is to make a API call.
I do not know which API I should call. Secondly, if someone else has a better suggestion on how to accomplish this I am all ears.
|
|
|
|
|
The following code should work:
Process.GetCurrentProcess().Threads.Count
www.troschuetz.de
|
|
|
|
|
dear All,
a) downloaded and installed the latest directX sdk for c#
yesterday.
however, discoffered that the documentation is only for c++
although c# is mentioned on the download website.
is there a c# directX doc?
b) i want to make an application showing loads of bars (bit like a bar chart). what is the best fucntion to do this in directX c#.
i was looking at vertex stuff, but i think it's a bit of an overkill for say 256 bars - output of an FFT)
many thanks, Dominik
|
|
|
|
|
As for the answer to b, I suggest the C# multimedia - DirectX[^] section on CP. My article is on a 2D game port and there are others that talk about just 2D and not 3D.
Steve Maier, MCSD MCAD
|
|
|
|
|
Hi all
I wrote an http download manager application for my personal use. First, I tried to open a tcp connection on port 80 and handled the handshake procedure with my own code. However not all servers gives the same replies so my application failed while connecting some secure sites...
Hence I decided to use the benefit of c# and replaced my http handshake stuff with webrequest and webresponse classes. But there is a problem.
Although it successfully downloads at first time, when I try to download another file on the same session, it ALWAYS throws a "(400) bad request" exception.
I even tried to download the same file twice, but again it downloaded on first try but threw the same exception on second try.
I have also tried request.abort() and response.close() methods to close any open connection but nothing changed!
If anyone can help me I'll appreciate.
Sincerely
can
mca@aecteknoloji.com
|
|
|
|