Friday, June 22, 2012

Myth Tick and Bookmark - HTML5

Pembacaan dan research ringkas tentang HTML5..
(rugi xresearch betul2 sebelum interview thun lepas..huuu)

"...'it' can only previously be done using javascript, now it focusing on browser..browser should and would be able to do all those thing"

sbg cth, sblm ni memainkan video hanya boleh dilakukan dengan bantuan player/plugin (eg flash player) html5 membolehkan browser itu sendiri memainkan video tanpa perlu mendonwload/memerlukan plugin tambahan..

themythstoodstill: Lepas ni nak buat html, boleh cuba html5..even skrg browser xsupport html5 sepenuhnya, tp in the future..

Tuesday, May 8, 2012

Myth Bookmark 2 : C# - Minimize WPF to System Tray in C#

Google Search: c#  WPF Minimize on Taskbar

The best solution found:

1. global variable for NotifyIcon

private System.Windows.Forms.NotifyIcon MyNotifyIcon;
2. initiate NotifyIcon. Declare/Initialize event to bring back App from taskbar
public MainWindow()
MyNotifyIcon = new System.Windows.Forms.NotifyIcon();
MyNotifyIcon.Icon = new System.Drawing.Icon(
MyNotifyIcon.MouseDoubleClick +=
new System.Windows.Forms.MouseEventHandler

3. Event/Button to minimize
private void btnQuit_Click(object sender, RoutedEventArgs e){   this.WindowState = WindowState.Minimized;}

4. Event bring back /restore App from taskbar
void MyNotifyIcon_MouseDoubleClick(object sender,
System.Windows.Forms.MouseEventArgs e)
this.WindowState = WindowState.Normal;

5. Balloon tips (mine not working. haven't fix yet [8/5/12])
private void Window_StateChanged(object sender, EventArgs e)
if (this.WindowState == WindowState.Minimized)
this.ShowInTaskbar = false;
MyNotifyIcon.BalloonTipTitle = "Minimize Sucessful";
MyNotifyIcon.BalloonTipText = "Minimized the app ";
MyNotifyIcon.Visible = true;
else if (this.WindowState == WindowState.Normal)
MyNotifyIcon.Visible = false;
this.ShowInTaskbar = true;

Thursday, January 26, 2012

Myth Bookmark 1 : C# - Get WPF Datagrid Selected Row Cell Value

Google : get wpf datagrid selected row cell value

Solution found :

private void dataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
DataGrid dataGrid = sender as DataGrid;
if (e.AddedItems!=null && e.AddedItems.Count>0)
    // find row for the first selected item
    DataGridRow row = (DataGridRow)dataGrid.ItemContainerGenerator.ContainerFromItem(e.AddedItems[0]);
    if (row != null)
        DataGridCellsPresenter presenter = GetVisualChild<DataGridCellsPresenter>(row);
        // find grid cell object for the cell with index 0
        DataGridCell cell = presenter.ItemContainerGenerator.ContainerFromIndex(0) as DataGridCell;
        if (cell != null)
static T GetVisualChild<T>(Visual parent) where T : Visual
T child = default(T);
int numVisuals = VisualTreeHelper.GetChildrenCount(parent);
for (int i = 0; i < numVisuals; i++)
    Visual v = (Visual)VisualTreeHelper.GetChild(parent, i);
    child = v as T;
    if (child == null) child = GetVisualChild<T>(v);
    if (child != null) break;
return child;