I am using a picture box to display a number of points on the screen. My problem is that I dont know how to resize the picture so I can see the points on all the picture box and not only in one part of the picture box.
Anka_Ame
Posts
-
Picture box and drawing -
Help with the run an executable program of a number of timesI am already using Process class to run the executable program. The output files are created by the arguments given to the executable program. I tried to give a different name to the output each time. I am runing the program with the help of a cycle. And the input changes name in each cycle and the output the same. But the only thing it's saved it is the last output. How can I solve this?
-
Help with the run an executable program of a number of timesI need to run an executable program from a C# program and I need to run the program of a a number of times and I have to save the output each time. I tried something but it saves my only the last output. How can I do it?
-
Write a character with a text writterI have a stupid problem. I dont know how to write the character " into a text writter. Can you help me?
-
DataSet and Relation between TablesI read a Xml file and I show it on a Windows Form. The problem is that the Xml file has a relationship between two tables named "Clusters_ClusterRoute", but I dont know how can I show this relation on the Windows Form. Can you help me?
-
Table in Window FormHow can I build a table on a Windows Form?
-
Windows Form TableHow can I build a windows form which contains a table?
-
Writing in a XmlI want to write in a Xml file some data, but I have an error because I have the same attribute "ClusterRoute" who appears many times. XmlTextWriter myXmlTextWriter = new XmlTextWriter(@"c:\\Results.xml", Encoding.UTF8); myXmlTextWriter.WriteStartDocument(); for (int i = 0; i < clustersList.Count; i++) { myXmlTextWriter.WriteStartElement("Clusters"); for (int j = 0; j < clustersList[i].Count; j++) { myXmlTextWriter.WriteAttributeString("ClusterRoute", clustersList[i][j].CityID.ToString()); } myXmlTextWriter.WriteEndElement(); } myXmlTextWriter.WriteEndDocument();
-
Time conversionthat's not my problem. I just want to read the value from a Xml file and to convert it to time, in a string without date.
-
Time conversionthis is the function which reads the Xml File and is part of a class Cities. public class Cities : List { public void OpenCityList(string filename) { DataSet cityDS = new DataSet(); try { this.Clear(); cityDS.ReadXml(filename); DataRowCollection cities = cityDS.Tables[0].Rows; foreach (DataRow city in cities) { this.Add(new City(Convert.ToInt32(city["X"], CultureInfo.CurrentCulture), Convert.ToInt32(city["Y"], CultureInfo.CurrentCulture), Convert.ToInt32(city["Demand"], CultureInfo.CurrentCulture), Convert.ToString(city["Open"], CultureInfo.CurrentCulture))); } } finally { cityDS.Dispose(); } } private TimeSpan startHour; public TimeSpan StartHour { set { startHour = value; } get { return startHour; } } public void ShowCityHour() { foreach (City cityhour in this) { startHour = cityhour.OpenTime; } } } And in another class, named City I have : public class City { private int demand; private TimeSpan openTime; public City(int x, int y, int citydemand, string open)// I am interested about the string open { Location = new Point(x, y); demand = citydemand; DateTime oTime = DateTime.Parse(open); TimeSpan openTime = oTime.TimeOfDay; } public TimeSpan OpenTime { get { return openTime; } set { openTime = value; } } } It is something like that. I take the data from the Xml file and I store it in the string open, and I want to convert it to time, because after that I will have to sort the whole list in order of the hours.
-
Time conversionThanks for trying to help me, but I dont want to make that. I want only to show the hour I read it from the Xml file. That's the problem, because I tried it and it shows something like 00:00, and not 07:30, like it should.
-
Time conversionI read a Xml file and from it I will have a string, for example the string name is open="07:30". I tried to read it like this DateTime oTime = DateTime.Parse(open); TimeSpan openTime = oTime.TimeOfDay; where openTime is of type TimeSpan. But the result is 00:00:00 and it doesnt work.
-
Time conversionThe problem is that I will take the string from a Xml file and I cant use it like that. I really need help.
-
Time conversionBut if my string is like this "07:30", what can I do? Because I tried that method and my result is 00:00:00. :doh:
-
Time conversionHi, I have a problem with the conversion of a string of type "07:30" into a time. I want to take only the time, without the date. I tried DateTime openTime = DateTime.Now.ToShortTimeString(open); ,where open = "07:30". Please help me with this problem.
-
Convert a list elementCan someone help me telling me how can I convert a element of a list to int?
-
TimeHow can I convert a value taken from a Xml file into a time value? Please help.
-
resize of image drawHow can I make that my drawing should be always starting from the center? I mean that I want to see the whole drawing even if the window will resize. Please help.:sigh:
-
Help textbox:) It's working to save it only like text. Thanks a lot.
-
Help textboxprivate: System::Void saveToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) { SaveFileDialog^ sfd = gcnew SaveFileDialog(); sfd->InitialDirectory = "c:\\"; sfd->FilterIndex =2; sfd->Filter = "TSP Files (*.tsp)|*.tsp|All files (*.*)|*.*|XML Files (*.xml)|*.xml|RTF Files (*.rtf)|*.rtf"; sfd->Title = "Save"; sfd->RestoreDirectory = true; if (sfd->ShowDialog() == System::Windows::Forms::DialogResult::OK) { filename = sfd->FileName; if ((myStream = sfd->OpenFile()) != nullptr) { RichTextBox^ rich = gcnew RichTextBox(); try { String^ strExt; strExt = System::IO::Path::GetExtension(filename); strExt = strExt->ToUpper(); if (strExt == ".RTF") { rich->SaveFile(filename); myStream->Close(); } else { StreamWriter^ txtWriter; txtWriter = gcnew System::IO::StreamWriter(filename); txtWriter->Write(textOutput->Text); txtWriter = nullptr; textOutput->SelectionStart=0; textOutput->SelectionLength=0; txtWriter->Close(); myStream->Close(); } filename = sfd->FileName; this->Text = "Editor: " + filename->ToString(); MessageBox::Show(filename->ToString() + " saved.", "File Save"); } catch (Exception^ e) { MessageBox::Show(e->Message->ToString(), "File Save Error"); } } } }