|
Then there must be another issue, that code above changes the colour of the text in the specified cell!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I'm wondering if the Subject is correct and pointing to the problem... If there's a hyperlink in the cell, would changing the Forecolor affect it, or is it going to default to the default hyperlink color?
|
|
|
|
|
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.
|
|
|
|
|
thanks , but there is no database or datasource for DataGridView , the user fill only the cells and I want to save this to an XML File .
thanks
RGDS!
|
|
|
|
|
Here is my code , plz help me !
SaveFileDialog saveDialog = new SaveFileDialog();
saveDialog.Filter = "Xml files (*.xml)|*.xml";
saveDialog.FilterIndex = 2;
saveDialog.RestoreDirectory = true;
saveDialog.InitialDirectory = "d:\\";
saveDialog.FileName = "XML File";
saveDialog.Title = "XML Export";
if (saveDialog.ShowDialog() == DialogResult.OK)
{
string OutPutXMLFile = "";
System.Xml.XmlDocument XMLDoc = new System.Xml.XmlDocument();
for (int i = 0; i < DataGridView1.Rows.Count; i++)
{
OutPutXMLFile = "";
for (int j = 0; j < DataGridView1.Columns.Count; j++)
OutPutXMLFile += String.Format("{0:0.00}", DataGridView1.Rows[i].Cells[j].Value);
XMLDoc.CreateElement(OutPutXMLFile);
}
}
but I've got an Error to create a xml file !
thanks !
|
|
|
|
|
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.
|
|
|
|
|
It's been a while since I've done component-level troubleshooting, but some of those color bands were *very* indistinguishable, especially when the manufacturer made them very thin. I remember browns and purples that were basically the same...
Anyway, interesting program idea.
|
|
|
|
|
devworx by Digit, in association with Microsoft is pleased to announce the Windows Phone Application development contest. Windows Phones have gathered popular consumer as well as developer interest in recent times.
If you're an app developer, then you'd be pleased to know of exciting rewards that could be yours, if you only participate!
For your first 3 Windows Phone apps, you get a free Windows Phone!
Even if you haven't specialised in Windows Phone all this while, you still stand a chance to win your very own Windows Phone, if you port two Android or iPhone apps to Windows Phone.
We have special plans for women developers too. The first 100 women participants stand to win a Windows Phone for their first app successfully submitted.
prateek
|
|
|
|
|
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);
}
|
|
|
|