|
The names of the enum values are strings, can't you use that?
public enum Animal { Dog, Cat, Mouse, Hippopotamus }<br />
Animal spot = Animal.Dog;<br />
string spotIs = spot.ToString();<br />
Console.WriteLine("Spot is: " + spotIs);
Output:
Spot is: Dog
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi!
I have a windows-app, that should perform normally when started with double-click.
If it is being started from an console/Dos-Box with more than 0 arguments it shall do a specific operation.
My problem is, that i cannot write console-output with Systen.Console.WriteLine("..."), because the application is set to be a windowsapplication. If i changed this to console-application i get an DOS-Box everytime i start the app with double-click (which looks stupid).
How can i make a windows application write it´s output to my DOS-Box or make the console-app not to open an DOS-box?
Help would be great!
Thanx a lot!
Greetings
J.
|
|
|
|
|
|
Hi,
Has anybody tried out creating an out of proc .NET component exposing
COM interface? We need to create component which would interact with Windows
powershell hence a .NET component and since it has to run on 64 bit system (Server)
but the client would be 32 bit thus a out of proc component which would
expose COM Interface.
Any pointers?
Thanks
Learning is a never ending process of Life.
|
|
|
|
|
Hi,
How to check if one type it is .Net type??
i have one list: Type[] list with many type. How can i know if one type it is .net type or one new type???
|
|
|
|
|
darkcalin wrote: Type[] list with many type. How can i know if one type it is .net type or one new type???
What do you mean by that? Surely they are all .NET types.
Do you mean, does the type belong to the .NET framework? If so, then I'm curious about why you would want to know that.
|
|
|
|
|
I want to find one solution for a big nonsolution ))
I want to know if it is System type
for example i have
Class class1
{
class2 bubu; // this is not a System type
int unu; //this is a simple type
int doi; //this is a simple type
}
|
|
|
|
|
darkcalin wrote: I want to know if it is System type
Then the full class name (the bit that includes the namespace) will start with System
|
|
|
|
|
is a god solution but i want to no make the string compare ...if is possible
|
|
|
|
|
How do I add and retrieve an image from MS Access
and then display it in a C# Form
Logically Onpoint
|
|
|
|
|
There are plenty tutorials on the subject. Try google, then if you get stuck, we can help you out. But... writing your code for you... No. You won't learn anything that way.
Hint: The classes you will need include OleDbConnection and OleDbCommand
|
|
|
|
|
hi,
in a client/server chat application the client can choose his fave font color and the server shld spread each client messages in its own unique font color. is there away to do that with the clients form displays messages in a richTextBox? (the only way i managed to do that is with listView)
many thanks
|
|
|
|
|
Hi!
You'd have to use the SelectionColor property for that. For example, something like this should work:
richTextBox1.Select(startOfMessage, 0);
richTextBox1.SelectionColor = Color.Red;
richTextBox1.SelectedText = "Message from User 1" + Environment.Newline;
richTextBox1.SelectionColor = Color.Blue;
richTextBox1.SelectedText = "Second message from User 2" + Environment.Newline;
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
|
How is it possible to maintain and share hashtables inside a webservice?
For example: a webservice adds data to hashtables. The hashtable data has to be shared between each application that calls the webservice.
p.s. I am trying to avoid creating files for each hashtable.
Thanks
|
|
|
|
|
i think by declaring ur hashtable as static will solve ur problem.
rahul
|
|
|
|
|
It does NOT because I am using static at present.
Thanks
|
|
|
|
|
A web service is (typically) stateless. This is the behaviour that you are seeing.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi all,
i am filling the data into CheckedListBox in PageLoadEvent,
and here i wanted to manipulate the selected/deselected values in itemCheckEvent BUT I AM Failing to do so, its givining Null Ref exception,,
see here, i am filling the checkedlistbox in the pageloadEvent,
and wat i need to do is, i need select/deselect the values of checkboxes
if i select i need to add to backend file,
if i de-select i need to remove from backend file.
for that i have choosen item_click event, but its giving null ref exception in the pageload itself coz i am adding values in pageload and also using the below code to catch select&deselect
private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (e.NewValue == CheckState.Unchecked)
{
lstChcked.Items.Remove(chklstMultipleMdfyTbl.SelectedItem.ToString());
}
else if (e.NewValue == CheckState.Checked)
{
lstChcked.Items.Add(chklstMultipleMdfyTbl.SelectedItem.ToString());
}
}
reply,,thnx in advance
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
I already told you that you should not register your event handler to the ItemCheck event until you loaded your data into the CheckedListBox i.e. register it in the Page_Load event handler after you're done with loading the data. I also told you how to register (by hand) and where you should find the original event registration (most probably added by the designer). What more do you need?
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
i am very sorry to bother u Again and Again,
but finally once plz look at my code once, so that i feel u can understand my problem.
i'm filling my checkelist box in pageload using the below code,,
private void frmCustomizeParams_Load(object sender, EventArgs e)
{
blnItemChk = true;
TestingBoard.XMLTasks GetLasersProperties = new TestingBoard.XMLTasks();
string[] LaserChecking = new string[xmltask.GetLaserPropCount("tabular", "property")];
bool[] chkedList = new bool[xmltask.GetLaserPropCount("tabular", "property")];
LaserChecking = GetLasersProperties.GetLaserProp("tabular", "property");
chkedList = GetAllLaserPropchk("tabular", "property");
for (int i = 0; i < LaserChecking.Length; i++)
{
chklstMultipleMdfyTbl.Items.Add(LaserChecking[i], chkedList[i]);
if (chkedList[i])
{
lstChcked.Items.Add(LaserChecking[i]);
}
}
}
}
Here is the ItemCheck Event Handler to Handle the Check/Unchecked Events of itemCheck Event Hanlder, here i am taking a listbox and want to fill selected/deselected values.
here is my Item_Check Event of CheckedListBox
private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (!blnItemChk)
{
}
else
{
if (e.NewValue == CheckState.Unchecked)
{
lstChcked.Items.Remove(chklstMultipleMdfyTbl.SelectedItem.ToString());
}
else if (e.NewValue == CheckState.Checked)
{
lstChcked.Items.Add(chklstMultipleMdfyTbl.SelectedItem.ToString());
}
}
}
Compiler is giving the below exception
{"Object reference not set to an instance of an object."}
Thnx alot for ur kind response till now,
very very sorry to bother u bye byes
prashanth,
|
|
|
|
|
pashitech wrote: but finally once plz look at my code once, so that i feel u can understand my problem
I've taken a look at your code and I fully understand your problem. Maybe you should take a closer look at my answers and try to realize them.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Change your Class1 to:
public class Class1
{
public int valInt;
public string valStr = string.Empty;
}
|
|
|
|
|
Yes,
the solution for this simple example is that but..... if i can't modify the class ...
|
|
|
|
|
Then XML serialization is not the way to go since it serializes only the public fields and properties.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|