|
No problem
jay_t55 wrote: (just general advice)
Search Google, MSDN and CP articles for your will, they're more helpful and faster. If you got any problem, ask it here and if anybody can help, surely will help you. Good Luck
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
I recently made a program for organizing marks and realized that it is slow and repetitive to type the same teacher's name 20 times for students in the same class.
I chose to add a little copy and paste feature when the user presses ctrl+v and the active cell becomes the contents of the clipboard.
Here is the snippet:
else if (e.Control && e.KeyCode == Keys.V)
{
if (Clipboard.ContainsText() & dataGridView1.CurrentCell.OwningColumn.Index == 4)
{
dataGridView1.CurrentCell.Value = Clipboard.GetText();
}
if (dataGridView1.CurrentCell.OwningRow.Index == nUD_counter)
{
dataGridView1.Rows.Add();
}
}
What I'm having problems with is the last part, where I add another row (Microsoft made it so it would automatically add a row if the cell is edited by the user, but not programatically. The problem is that when I add the new row, it places it above the row which I just pasted info into such that:
col1 col2
a b
<-blank line where I press ctrl+v->
It becomes
col1 col2
a b
<-blank line where I press ctrl+v->
hi
How can I fix this? Also feel free to make suggestions on my code.
Thanks in advance.
modified on Saturday, November 1, 2008 5:23 PM
|
|
|
|
|
I messed around with it a bit and ended up using SendKeys. I know this isn't the best method, but its the only one I tried so far that works.
Basically,
try
{
dataGridView1.BeginEdit(true);
String tempText = Clipboard.GetText();
tempText = tempText.Replace("{", "{{}");
tempText = tempText.Replace("}", "{}}");
tempText = tempText.Replace("{{{}}", "{{}");
tempText = tempText.Replace("(", "{(}");
tempText = tempText.Replace(")", "{)}");
tempText = tempText.Replace("+", "{+}");
tempText = tempText.Replace("^", "{^}");
tempText = tempText.Replace("%", "{%}");
tempText = tempText.Replace("~", "{~}");
SendKeys.Send(tempText);
SendKeys.Send("{DOWN}");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\n\nThe previous value was restored.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
dataGridView1.CurrentCell.Value = previousValue;
}
|
|
|
|
|
Hi,
I need to generate an ordered sequence of numbers from 1 - 9. At no point is any number allowed to be used twice.
There are 81 combinations.
So it would look something like this:
123456789,
192345678,
193456782,
194567823,
195678234,...
and so on.
Thanks
|
|
|
|
|
Hi,
that has been asked and answered here[^].
And there are 9! permutations (that's 362880, not 81).
|
|
|
|
|
i have a datatable contain 3 columns(id,type,price);
and a sqldatareader have a 1 column(name);
i want to add the column(name) from sqldatareader to datatable
using datacolumn,,
please how I can do that??
thanks all
|
|
|
|
|
Hi all.
I wanna create a plugin for Internet Explorer with C# ?
How can I do it ?
Thank you
|
|
|
|
|
Hi Mohammad,
Take a look here[^]. There's the same question, hope help
While (true) { Human.isLearnable = true; }
|
|
|
|
|
Hello.
I have a MP3 file. I wanna split it where the volume is silent.
How can I do it ?
Thanks in advance .
|
|
|
|
|
I don't know if this article[^] uses zero crossing for determining the split location - but it shold get you started.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
An mp3 file is divided into blocks, so you would only be able to split the sound stream between blocks. Also, it would be very hard to analyse the sound while it's compressed.
You have to decompress the file in order to easily analyse it and split it where you want. Then you can either save the parts as wave files or compress them into mp3 files.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks Guffa.
Do you have any references about it for further learning ?
|
|
|
|
|
www.google.com[^]
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
How i CReate Ajax Control
How This Don.
I Want On Drop Down List.
When i Select any Item Then open other Window Which inClude Detail information about That Item
How This Done . Please Reply urgent
Please Send me Code
Ishtiaque Hussain Jalbani.
Thanks in advance
|
|
|
|
|
Hello Ishtiaque,
It seems you're new in CP, am I right?
So, take a look at the first post in page 1 titled "How to get an answer to your question" by "Chris Maunder". There are several great articles here in CP also, like CodeProject Forum Guidelines[^] by Scott Dorman or Some guidelines for posting questions in the forums[^] by Pete O'Hanlon. They will help you posting your question.
For this question, you better ask it in ASP.NET forum or Php forum.
Good Luck
While (true) { Human.isLearnable = true; }
|
|
|
|
|
Hi!
I'm working on an application which will need to insert text into a RichTextBox where the user is currently writing. But to do that I need the index of where the text marque is. Does anyone know how to insert some text into the a RichTextBox where the text marque is or how to get the index position of the text marque?
(I don't know what it's called, therefore I call it text marque. I mean the thing which is in front of the text you're writing in e.g. a RichTextBox)
/GuitarComet
|
|
|
|
|
GuitarComet wrote: how to get the index position of the text marque?
It's called the "caret". The property you're looking for is SelectionStart.
|
|
|
|
|
Hello
I want to access data from peach tree files in C# data structures.
How it is possible?
Any one do it before?
Which components/Classes are required for the compeletion of this task.
Thanks
Syed Shahid Hussain
|
|
|
|
|
You should contact the company directly and se if they have an API. If they don't, you may have to use amy built in export/import functions to make the data .net accessible.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I wont how to use OCR techniques to read images and extract text from it but with my own characters and symbols ,that mean it will identify my symbols to that image and extract it ?
(like fine reader program it recognize english and some languages but i wont to make prog to recognize symbols and characters of my own and i will create ??
|
|
|
|
|
|
I want to write a program in C#.
This program prevents specified files from being deleted.
Anyone can offer some ideas?If you'd like to provide part of code,it's better.
Thank you very much!!
|
|
|
|
|
If your program holds on to the file by having it open then the file cannot be deleted.
|
|
|
|
|
It also may prevent any/all access to that file.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Even less chance of the file being damaged then.
|
|
|
|