|
If you are using .net 2.0 there is a new method called GetSelectedIndices which returns an array of int of the indexes.
public virtual int[] GetSelectedIndices ()
If you are using .net 1.1 you will need to loop through the indexes in your listbox and call listbox.GetSelected(index) passing in your index. If the method returns true the item is selected.
Hope that helps.
Ben
|
|
|
|
|
Thanks Ben
I did this,
byte[] aGroup = new byte[1024];
string hexString;
for (int index = 0; index < SecurityGroups.Items.Count; index++)
{
if (SecurityGroups.Items[index].Selected)
aGroup[index] = 1;
}
|
|
|
|
|
Hi!.. i´m new in that tools C#, and i don´t know i can see and modify my controls on the groupbox. i need a simple example or show what is the functionality, please.
thank, you. i see you soon.
|
|
|
|
|
When you add controls to a group box through the GUI interface for form building, the controls are accessable directly from anywhere in your form class. Just use the control names. If for some strange reason you need to, you can also use the group box's Controls property to get at them as well, though that's usually only used in special situations.
|
|
|
|
|
ok, i understood you, ok, only with the control's name i can have access, thank you, and if i want to know how many controls i have in the form, how can i do?.. with what method?.. thank you again..
|
|
|
|
|
int ctrlCount = groupBox1.Controls.Count;
|
|
|
|
|
thank you, Bonesoft.
|
|
|
|
|
Can i get the row number of one record from a DataTable, after searching it with it's find() method?
Thank you
Joaquim
|
|
|
|
|
|
No, this example does not work, because what you get is the record position in the DataView, that is not always the same as the record position in the datatable:
Example - a table with 4 records:
0) "9999"
1) "8888"
2) "6666"
3) "5555"
After you sort it at the DataView, it became:
0) "5555"
1) "6666"
2) "8888"
3) "9999"
And if i search the value "9999" the index should be 3, but i want the index 0 (that's the real index at the DataTable).
I need this index for positioning in the DataGrid.
Thank you anyway.
P.S. i'm not a Englis speaker, can you explain to me your last statement: 'only two letters away from being an asset', i don't know if i got it right.
|
|
|
|
|
joaquimc wrote: After you sort it
The don't sort it
only two letters away from being an asset
|
|
|
|
|
I have a web service listener that has a function that generates an XML file.
For some reason, it cannot get past the line of code below with the asterix
string xmlFilename = string.Format ("C:\\{0}.xml", m_Tag);
XmlTextWriter writer = null;
writer = new XmlTextWriter(xmlFilename,System.Text.Encoding.UTF8);*****************************
writer.Formatting = Formatting.Indented;
writer.WriteStartDocument ();
This code works fine on my form application. Is there something i am missing.
Any input is appreciated.
Thanks,
Colin
|
|
|
|
|
Most probably a security issue... your webservice listener must be running under a user account (ASPNET?) that does not have permission to write to the root of you c:\ drive.
Roel
|
|
|
|
|
That is a good possiblity. However, i wrote to a regualr txt file using stream writer and i was able to write to a folder on my root. So is it safe to say that if i could write to C:\MyFolder, that i should be able to write to the root directly i.e. C:\??
|
|
|
|
|
LCI wrote: This code works fine on my form application. Is there something i am missing.
You mean like the exception information?
led mike
|
|
|
|
|
Thanks for the reply.
The exception information is even more baffling.
It basically says that access is denied to C:\WINDOWS\System32\This.xml
The path that i am telling the code to generate the XML is
C:\Test\This.xml
Any thoughts are appreciated.
Thanks,
|
|
|
|
|
Based on your post my only thought is that there is something you don't know and therefore aren't telling me because what you posted is just not going to happen in a normal environment.
led mike
|
|
|
|
|
Greetings Good People,
What are some good software products that I can use to design the classes, class hiearchies, system, subsystems, messages, (even UML), etc... of an application that I am working on? Does Visual Studio 2005 facilitate such functionality. I am a C++/C# developer (actually I'm a newbie).
Thanks for your time,
BP
|
|
|
|
|
If you have questions about Visual Studio or what IDE to use for your .NET development, I suggest you visit Microsoft's Visual Studio site and read-up on that product and what's available, and/or use Google to search for more.
This board pertains to specific C# development code questions, and not IDE related questions such as yours.
Thank you for your consideration.
|
|
|
|
|
At BoneSoft.com I have a tool that uses a pseudo code language similar to C# specifically for building models. It's kind of a happy medium between real code and UML. It's a language, but it's small and concise so it's easier to visualize and requires a lot less time to type than full code. It sounds somewhat like what you are looking for.
The language is very similar to C# in syntax with the exception that specifying classes looks more like interfaces. The tool expands your pseudo code spec to full code in various languages, including C# and VB.Net. It can also build code models from XML, XSD, and SQL Server databases.
The tool gives you some control on how the output code is formatted, and can include XML serialization attributes as well.
Other than that, there are several decent UML tools out there, but most that can round trip C# code are pretty pricy.
Hope that helps.
|
|
|
|
|
can we write the code of console application into window application form
okey
|
|
|
|
|
Do you mean turn a console app into a windows app?
If you do then just make a new windows app project and move the code across.
|
|
|
|
|
In the project options, you can choose if your application should be a Windows Application or a Console Application.
The difference is just that a console app has a console window and a Windows app doesn't (so Console.WriteLine in a Windows app gets displayed nowhere).
In both application types, you can reference System.Windows.Forms to display forms.
|
|
|
|
|
it is a good approach to use utility instead of stored procedure???
okey
|
|
|
|
|