 |
|
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid..
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
hi
i have in my C# WinForm program DataGridView
i need to change the text color of any cell by code.
how to do it ?
thanks in advance
|
|
|
|
 |
|
 |
Hi everyone! I am trying to write a string of text on Panel control modeled like a sheet of paper. There is no limit to the length of the text which means that I may need three of four or more of the sheets.
I am now facing a problem of knowing the last line of the text for a page so that if there are more words, I can add another sheet and write the rest of the text. I'm fighting with how to determine the point in the full text at which a page will be full so that I can create another sheet and add the rest of the text to the new sheet. Any ideas please. Thanks in advance.
|
|
|
|
 |
|
 |
Assuming this is a WinForms Panel you're talking about, and you are drawing text using Graphics.DrawString(), then what you need to look at is Graphics.MeasureString()
Given the right parameters, it will predict how much area DrawString is going to need to paint a string.
Luc Pattyn [My Articles] Nil Volentibus Arduum
Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.
|
|
|
|
 |
|
 |
hi guys ....
i am having a report includes tablix "matrix" with row and column groups in the body of the report. I want to align the tablix at the center of the report after loading the data from my dataset.
another question:
my report always displayed in 2 pages whlie the 2nd page is empty "only header and footer are displayed" i tried 2 rezise every thing smaller but its already fits one page.
|
|
|
|
 |
|
 |
Hi All !
I want to save the content(Row And Column Cell) from a DatGridView To A XML file .how can i do it ?
thanks in advance for any Help !
|
|
|
|
 |
|
 |
If you DataGridView has a datasource, then simply use the WriteXml property[^]. This[^] explains the same process with code.
|
|
|
|
 |
|
 |
Hi All !
is there any help or Link to Animate BackColor Form ... .
Thanks A Lot !
|
|
|
|
 |
|
 |
What are you trying to do?
Is this a windows form, and you just want to change the background colour?
|
|
|
|
 |
|
 |
almost Like This , and in Windows Form . this change Color can be from left to Right and ... .
thanks
|
|
|
|
 |
|
 |
That's a bad idea in Windows Forms as you will be redrawing the entire form over and over again. Performance will be pretty bad.
WPF would have a better time with this, though the learning curve for WPF is very steep.
|
|
|
|
 |
|
 |
i have any problem about in visual C# source code.
how to make the application resistor color code in Visual C #?
I ask for its support ......
thank's
|
|
|
|
 |
|
 |
Your question doesn't make much sense. Please edit it and add more meaningful information.
|
|
|
|
 |
|
 |
Come up with a set of requirements first. What do you want this app to do?
Then break down those requirements into small parts you can solve and come up with designs for those parts.
Then code each part to the design until you have all of the problems solved.
|
|
|
|
 |
|
 |
I would like this application, when I select the colors of the band resistor will be out the amount of value in the "ohm"
you have an example source code?
|
|
|
|
 |
|
|
 |
|
 |
You're most likely NOT going to find example source code for this.
This shouldn't be that hard. Picking the number of bands and the colors for each would probably be the hardest part. After that, it's pretty simple to do the math to get the resistor value.
|
|
|
|
 |
|
 |
this is not a gimme-code site. You can come here and ask specific questions when you tried something yourself and got stuck somehow.
Resistor colors to resistance value conversion is a pretty simple homework assignment. Get to it.
Luc Pattyn [My Articles] Nil Volentibus Arduum
Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.
|
|
|
|
 |
|
 |
Message Automatically Removed
|
|
|
|
 |
|
 |
how can i handle Datagridview's Keydown Event after editing cell on Enter key Press
datagridview have columns readonly=false and columns readonly=true
need when i press enter key goto cell[6] of next row from any cell in previous row (====> this important one)
and when i press tab from cell [4] call func and tab from other cells call another func
|
|
|
|
 |
|
 |
the answer
private const UInt32 WM_KEYDOWN = 0x0100;
public bool PreFilterMessage(ref Message m)
{
if (this.ActiveControl is DataGridViewTextBoxEditingControl)
{
if (m.Msg == WM_KEYDOWN)
{
Keys keyCode = (Keys)(int)m.WParam & Keys.KeyCode;
if (keyCode == Keys.Enter)
{
if (this.dgvReadInsert.CurrentCell.ColumnIndex == 4 || this.dgvReadInsert.CurrentCell.ColumnIndex == 10 || this.dgvReadInsert.CurrentCell.ColumnIndex == 6 || this.dgvReadInsert.CurrentCell.ColumnIndex == 12 || this.dgvReadInsert.CurrentCell.ColumnIndex == 13 || this.dgvReadInsert.CurrentCell.ColumnIndex == 14)
this.dgvReadInsert.CurrentCell = this.dgvReadInsert[6, this.dgvReadInsert.CurrentCell.RowIndex + 1];
return true;
}
}
return false;
}
return false;
}
after inherit from
class form1 : Form, IMessageFilter
|
|
|
|
 |
|
 |
I have a situation where I am parsing through a string generated by serialPort1.ReadExisting(). I started getting somewhat random errors, and to troubleshoot this I started writing each value of the string parsing, to a textbox window.
It appears that sometimes the entire stream is not being received, because the length of RxString is changes sometimes and I believe that my errors are caused when only 1/2 of a single value of data I am trying to parse, is received, so that when I'm doing string.indexof, there is nothing left and it is causing "failed StartIndex cannot be less than zero" error message.
Has anyone experienced this before? Or can anyone speculate what I might be doing wrong in my code?
private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
if (serialPort1.IsOpen)
{
RxString = serialPort1.ReadExisting();
this.Invoke(new EventHandler(displayData));
}
else
{
return;
}
}
private void displayData(object sender, EventArgs e)
{
int count = 0;
try
{
count = 0;
if (Regex.Match(RxString, @"\r") != null)
{
RxString = Regex.Replace(RxString, @"\r", "\r\n", RegexOptions.Multiline); }
if (RxString.Contains("ps2="))
{
count = count + 1;
txtDiagnostic.Text += count + ", ";
int totalLength = RxString.Length;
txtDiagnostic.Text += totalLength + ", ";
int startDelimiter3 = RxString.IndexOf("ps2=");
txtDiagnostic.Text += startDelimiter3 + ", ";
string ps2String = RxString.Remove(0, startDelimiter3 + 4);
int endDelimiter3 = ps2String.IndexOf("\r\n");
txtDiagnostic.Text += endDelimiter3 + ", ";
ps2String = ps2String.Remove(endDelimiter3);
rtbPressureSensor2.Text = ps2String;
txtDiagnostic.Text += ps2String + System.Environment.NewLine;
Application.DoEvents();
}
Thread.Sleep(250);
}
catch (Exception ex)
{
MessageBox.Show("displayData() failed " + count + " " + ex.Message);
}
|
|
|
|
 |
|
 |
Serial communication is just that: data arrives as a stream of databits, some of which are parts of characters, others are framing which wrap the characters and provide a way to identify when they start, stop, and if there are received correctly.
When the bit stream arrives at the hardware, it finds each character one by one and hands that on to the OS software. The software hands it to the .NET framework, which then raises an event to tell you that there is data. While the OS and the framework are doing this, and while your program is sorting itself out to process the character, the databits are still arriving, and still being processed by the hardware into characters - and it is telling the OS each time it has one. So, when your program finally gets allowed to look at the data (and bear in mind that may not be immediately as Windows in a multitasking OS) there could be anything from one character to the whole message waiting for you. If may take one, or many DataRecieved Events to receive the whole message - and the number could be completely different next time you try because what else is going on in the whole system is different.
You can't just look at the currently available data - you have to look at the whole message. Which means you need to buffer it up until you have got to the end of the message, or a suitable amount of time has passed without getting the whole message. if you just read the data into a single string each time you get a DataRecieved event, all you will do is most likely throw away the data you have already got...
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
 |
|
 |
Hi,
Thank you for the reply.
I cannot buffer it until I get everything, as it is a logging function and I believe I could end up hogging too much memory.
What is the best practice for receiving chunks of data and then parsing it? Do I have to have synchronization for this on both my PC and microchip end? I was hoping that if I only streamed updated data every 250mS from the source, that I would not encounter issues like this.
|
|
|
|
 |