in reply to Re: Win32::GUI::Grid & Date Formats
in thread Win32::GUI::Grid & Date Formats
The SetCellFormat method is probably not what I need to use here but I have no idea how to make it work. After you select a date using the control, the cell will display the date in whatever your short date format is. If you change your short date format and re-run the program, it will display in the new format you set. I want to ignore the default setting for the system and set the format myself.#!c:\perl\wperl.exe use strict; use Win32::GUI; use Win32::GUI::Grid; my $mainform = Win32::GUI::Window->new(-name=>'main',-text=>'Grid Date + Format Problem',-width=>810,-height=>625,-dialogui=>1); my $grid = $mainform->AddGrid(-name=>'grid',-pos=>[25,85],-rows=>2,-co +lumns=>3,-fixedrows=>1,-fixedcolumns=>1,-editable=>1,-size=> [520,400 +],-addstyle=>WS_VSCROLL|WS_TABSTOP); $grid->SetColumnWidth(0,100); $grid->SetColumnWidth(1,100); $grid->SetColumnWidth(2,100); $grid->SetRowHeight(1,30); $grid->SetCellText(0, 0, "ID"); $grid->SetCellText(0, 1, "GVIT_DATECAL"); $grid->SetCellText(0, 2, "GVIT_DATE"); $grid->SetCellFormat(1, 1, 'yyyy-MM-dd'); $grid->SetCellType(1, 1, GVIT_DATECAL); $grid->SetCellText(1, 1, "2005-07-19"); $grid->SetCellFormat(1, 2, 'yyyy-MM-dd'); $grid->SetCellType(1, 2, GVIT_DATE); $grid->SetCellText(1, 2, "2005-07-19"); $mainform->Show(); Win32::GUI::Dialog();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Win32::GUI::Grid & Date Formats
by diakonos (Hermit) on Jul 21, 2005 at 14:59 UTC | |
by ChrisR (Hermit) on Jul 21, 2005 at 15:25 UTC | |
|
Re^3: Win32::GUI::Grid & Date Formats
by anonymized user 468275 (Curate) on Jul 20, 2005 at 16:03 UTC | |
by ChrisR (Hermit) on Jul 20, 2005 at 17:28 UTC | |
|