|
More exactly i try the url that contain the port.
|
|
|
|
|
Enclose the code in a try catch block and log the Exception message. You'll know why your call failed after the call times out.
|
|
|
|
|
i tried this but if the url not exist first the program is blocking for 20 seconds and after give me a message :"Unable to connect to the remote server".
|
|
|
|
|
That's the correct behavior. What else you want it to do?
|
|
|
|
|
That's the error that Shameel is talking about.
If the url is being entered at runtime by the user and you want to validate the url before trying it, then there is no really simple way to do this. In this case you would have to write a validation method before you try the url.
Otherwise, the suggestion you have received already is the correct one.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
I want if the url is not valid the program skip quickly over this sequence.i want the program doesn't blocking
|
|
|
|
|
Then you need to run the web request in a background thread (or BackgroundWorker or Task).
|
|
|
|
|
This a good idea!I will try this.Thanks
|
|
|
|
|
hi
i have in my C# WinForm program DataGridView
i need to change the text color of any cell by code.
i try this:
dataGridView8[0, rowCounter].Style.ForeColor = Color.Red;
but it dosnt work
how to do it ?
thanks in advance
modified 13-Feb-12 2:12am.
|
|
|
|
|
Identify the Cell and change it's ForeColor.
Cell.ForeColor = "Red";
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i try this:
dataGridView8[0, rowCounter].Style.ForeColor = Color.Red;
but it dosnt work
|
|
|
|
|
This worked for me.
private void btnGC_Click(object sender, EventArgs e)
{
List<string> lData = new List<string>();
lData.Add("this one");
lData.Add("this one");
lData.Add("this one");
lData.Add("this one");
lData.Add("this one");
lData.Add("this one");
lData.Add("this one");
this.dataGridView1.DataSource = lData;
this.dataGridView1[0, 3].Style.ForeColor = Color.Red;
}
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
thanks for the help, but the color dosent change
|
|
|
|
|
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
|
|
|
|