Hi everyone.I hope this is the right forum for it. I've so far been unable to fine a good site to get answers to my questions even on other forums. But i find this site the most user friendly C++ site to learn from.
i'm new to C++ and have to code a program. i use microsoft visual studio 2008 and wish to use the Calender component as a selection point to display contents of a file that has been labelled as a certain date and show it in the list box, but i dont really know the code to use to continue the code after a date has been selected.
Heres the code for the components on the page
private: System::Windows::Forms::Button^ button3;
private: System::Windows::Forms::Button^ button4;
private: System::Windows::Forms::Button^ button5;
private: System::Windows::Forms::ListBox^ listBox2;
private: System::Windows::Forms::ListBox^ listBox1;
private: System::Windows::Forms::MonthCalendar^ monthCalendar1;
private: System::Windows::Forms::DateTimePicker^ dateTimePicker1;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Button^ button1;
protected: |
And heres the code for the calender
void InitializeComponent(void)
{
...some codes for other components
/
// monthCalendar1
//
this->monthCalendar1->CalendarDimensions = System::Drawing::Size(2, 1);
this->monthCalendar1->Location = System::Drawing::Point(13, 23);
this->monthCalendar1->Name = L"monthCalendar1";
this->monthCalendar1->TabIndex = 5;
this->monthCalendar1->DateChanged += gcnew System::Windows::Forms::DateRangeEventHandler(this, &Form1::monthCalendar1_DateChanged);
//
// dateTimePicker1
//
this->dateTimePicker1->Location = System::Drawing::Point(12, 190);
this->dateTimePicker1->Name = L"dateTimePicker1";
this->dateTimePicker1->Size = System::Drawing::Size(208, 20);
this->dateTimePicker1->TabIndex = 10;
this->dateTimePicker1->ValueChanged += gcnew System::EventHandler(this, &Form1::dateTimePicker1_ValueChanged);
|
i have a month calender view and a combo box showing the date and times. but i wish to get it to refer to a file and show the corresponding data from the file on 1 of the listbox.
for the file, i've input the data as
[Date] [ID] [Detail1] [Detail2]
So i'm not so sure exactly how would i extract the data from that format by following columns as it would be impractical to use many files for each data list when they have to be linked to each other
Although i do wish to know how do i code a button to show another form/window thats in the project? lets say if i were to click on button3 on form1, it will show form2.
I've used visual basic and java but i dont really know all the C++ commands. And i find VB harder than Java due to the way i think. But i cant think in terms of VB to complete my project and my teacher wont let me use VB, so i chose C++ since its similar to java and i dont know how to code complex visual programs in java.
Thank you.