|
Will try it, but dunno if it happens after the sort and redraw. Thanx for your time and i hope someday can help you.
|
|
|
|
|
OK, im going to try and explain this the best I can. I have a listview that shows things by category with an associated treeview for displaying specific categories. I have the ItemCheck event handler changing categories whenever an item is checked and remove it from the listview. the problem is if the item is the last item in the listview when the box is checked/unchecked the program.cs throws an argument out or range exception. does anyone know why or how to fix it?
|
|
|
|
|
based on your words
numbers1thru9 wrote: the problem is if the item is the last item in the listview when the box is checked/unchecked the program.cs throws an argument out or range exception. does anyone know why or how to fix it?
can you show your code??
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
private void lvTasks_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (lvTasks.Items[e.Index].Checked == false && lvTasks.Items[e.Index].SubItems[6].Text == "0")
{
//sql.makeCompleted(user_num, lvTasks.Items[e.Index].SubItems[4].Text);
taskList.Remove(lvTasks.Items[e.Index]);
lvTasks.Items[e.Index].SubItems[6].Text = "1";
lvTasks.Items[e.Index].SubItems.Add(DateTime.Today.Date.ToShortDateString());
completedTasks.Add(lvTasks.Items[e.Index]);
lvTasks.Items.RemoveAt(e.Index);
}
else if (lvTasks.Items[e.Index].Checked == true && lvTasks.Items[e.Index].SubItems[6].Text == "1")
{
completedTasks.Remove(lvTasks.Items[e.Index]);
lvTasks.Items[e.Index].SubItems[6].Text = "0";
lvTasks.Items[e.Index].SubItems[7].Text = "";
taskList.Add(lvTasks.Items[e.Index]);
lvTasks.Items.RemoveAt(e.Index);
}
|
|
|
|
|
Need a little help of adding \n to a string wherever a full stop appears in the text. I have looked at the relpace method, but as stated this replaces the specified character.
|
|
|
|
|
str.Replace(".", "." + Environment.NewLine);
"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
|
|
|
|
|
string mystring= "This.is.a.test";<br />
string[] splitedData= mystring.Split('.');<br />
string result= "";<br />
<br />
for (int i = 0; i <= splitedData.Length-1; i++)<br />
{<br />
result= result+ splitedData[i].ToString() + "\n";<br />
}
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
You never want to hardcode the "\n" in .NET any longer. Use Environment.NewLine.
|
|
|
|
|
|
Hello,
edboe wrote: Use Environment.NewLine
good info!
Is there also a function for "\r\n"?
Thanks for youre help.
Martin
|
|
|
|
|
Martin# wrote: Is there also a function for "\r\n"?
There is. It's called Environment.NewLine .
MSDN topic of Environment.NewLine Property[^] states that the property value is "A string containing "\r\n" for non-Unix platforms, or a string containing "\n" for Unix platforms."
"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
|
|
|
|
|
Stefan Troschütz wrote: There is. It's called Environment.NewLine ;)
again and again
Thank you Stefan!
Maybe next time I do a little researche.
Martin
|
|
|
|
|
Hi.
Does anyone know haw exactly does the Windows OnScreenKeyboard work?
To be more specific, I'm interested in how it simulates the actual keystrokes (not like SendKeys.SendWait(), SnedMessage() or PostMessage() work, but like you're really working with the keyboard).
Another thing of interest is how it never takes the focus when you click the keys?
I've tried to simulate it using SendKeys,SendMessage or PostMessage, but I always need to transfer the focus back on the receiving form, which is obviously not a good approach.
Can anyone give me a hint?
|
|
|
|
|
Hello,
I have created a CustomEventLog. I am using the EventLogInstaller class and using Installutil.exe to install my log. However I notice that the MyCustomLog.Evt file is not being generated?
Does anyone know how the .Evt file gets generated?
Thanks so much for the help.
RB
|
|
|
|
|
I don't know about using Installutil.exe to install an event log, but I do know that when you create an Event Source using EventLog.CreateEventSource(), the event log will be created automatically if it doesn't exist already.
if (!EventLog.SourceExists("SourceName"))
EventLog.CreateEventSource("SourceName", "LogName");
will create an event log for you named LogName.evt (it will be in the \System32\config directory) with a Source of SourceName .
To write to it:
EventLog myLog = new EventLog("LogName",".","SourceName");
myLog.WriteEntry("Loggin my event...");
Documentation:
EventLog.CreateEventSource Method (String, String) [^]
This method can also create a new custom log on the local computer.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Thank you.. I have been doing it this way as well. I just did not see my new LogName.evt showing up in my \System32\config directory. However I restarted my system and the file appeared. Go figure.
Thank you.
RB
|
|
|
|
|
Hello...
Does anybody has this bug also ?
If you open a file in VS2005 (File | Open - File), then just select a directory with a lot of icons.
Then you can see, the icons for the files are wrong. It should be : ICON[i] = FILES[i-2].
But in OpenFileDialog is ok.
|
|
|
|
|
I do no experience it. How many icon files do you have?
Alexandru Ghiondea
MCP
|
|
|
|
|
Bug? In Microsoft Software? No way!!!
That one I have not seen.
|
|
|
|
|
i read the book of " Schaum’s outline series , THEORY AND PROBLEMS OF DATA STRUCTURES" BY SEYMOUR LIPSCHUTZ.
it is a cool book but in it’s programming problems he want program like in ch5
can any one help tell me if i can make it by c#
or how can i find the answers of this problems
thanks lot
|
|
|
|
|
amirafouad21 wrote: he want program like in ch5
This makes no sense.
amirafouad21 wrote: can any one help tell me if i can make it by c#
You can do pretty much any programming problem in C#.
amirafouad21 wrote: how can i find the answers of this problems
Sounds like you are asking for homework answers. This is a no-no. Also, please title your posts more appropriately rather than just using 'help.'
____________________________________________________
If at first you don't succeed, skydiving might not be for you.
|
|
|
|
|
leckey wrote: amirafouad21 wrote:
he want program like in ch5
This makes no sense.
I think he assumes we have mind reading abilities to know what is ch5
leckey wrote: Sounds like you are asking for homework answers. This is a no-no. Also, please title your posts more appropriately rather than just using 'help.'
I agree. I just love 'help' threads
If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa
|
|
|
|
|
You can rewrite the question like this:
I have a homework assignment. I noticed a similar example in another language in chapter 5 of this book.... Can you rewrite the example for me in C#, so I can hand it in.
|
|
|
|
|
very thank for your advice edboe , all you write is right and this is the problem can u help me edboe.
the question in liked list in data structure, the problem is that i want an algorithm or code in c# for this case that say write a program which reads an integer K and prints the list of clients of lawyer K and test the program for each K.
i know there is a pointer in c# but how i can make it.
thx a lot
|
|
|
|
|
Could anyone tell me how I could replace the system tray clock? I have seen a lot of applications do that, like ChameleonClock, and would like to do one myself. If somebody could give me some clues on doing that, I would really, really really appreciate it.
Thanks
-----
Vandra Akos
|
|
|
|