Friday, April 21, 2006

Work Related

C#.Net 2003 windows programming

//Get mouse position in client coordinates
Point p = picBoxDrawingArea.PointToClient(Control.MousePosition);

//Get Mouse Position on screen
Control.MousePosition;

Work Related

C#.Net 2003 windows programming

//Get mouse position in client coordinates
Point p = picBoxDrawingArea.PointToClient(Control.MousePosition);

//Get Mouse Position on screen
Control.MousePosition;

Thursday, April 13, 2006

Work Related

Doing Custom DataGridTextBoxColumn in C#.Net

This Column, has a Centered Header, but contains right aligned numeric data. Also the background Colour is changed according to cell value.

private StringFormat m_strFormat = null;

public UCCustomColumn()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
// TODO: Add any initialization after the InitializeComponent call
m_strFormat = new StringFormat();
m_strFormat.Alignment = StringAlignment.Far;
m_strFormat.Trimming = StringTrimming.None;
}

protected override void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum, Brush backBrush, Brush foreBrush, bool alignToRight)
{

SolidBrush BackgroundBrush;
// Get value on current cell
double dValue = (double) this.GetColumnValueAtRow(source, rowNum);
string strValue = dValue.ToString(this.Format);
double dATValue,dUVValue;
if (rowNum ==0)
{
dATValue = (double)this.GetColumnValueAtRow(source, rowNum);
dUVValue = (double)this.GetColumnValueAtRow(source, rowNum+1);
}
else
{
dATValue = (double) this.GetColumnValueAtRow(source, rowNum-1);
dUVValue = (double)this.GetColumnValueAtRow(source, rowNum);
}

SolidBrush StrongBrush = new SolidBrush(Color.FromArgb(51,102,255));
SolidBrush MediumBrush = new SolidBrush(Color.FromArgb(153,204,255));
SolidBrush SoftBrush = new SolidBrush(Color.White);


if((dATValue >25.7) && (dUVValue >=3))
BackgroundBrush = StrongBrush;
else if((dATValue <=25.7) && (dUVValue >=3))
BackgroundBrush = MediumBrush;
else if((dATValue <=25.7) && (dUVValue <3))
BackgroundBrush = SoftBrush;
else
BackgroundBrush = SoftBrush;

g.FillRectangle(BackgroundBrush, bounds);
RectangleF CellBounds = new System.Drawing.RectangleF(bounds.Left, bounds.Top, bounds.Width, bounds.Height);
g.DrawString(strValue, this.DataGridTableStyle.DataGrid.Font, foreBrush, CellBounds, m_strFormat);
}

Monday, April 03, 2006

Work Related

Dependency walker Visual studio 6
a great way to look all public methods in a DLL

Work Related

Dependency Walker visual studio 6
is a good tools to view all public methods in a DLL

Work related

How to open PDF file programmatically in windows c#.Net

Solution 1
Use Process.Start()
Solution 2
host the web browser control in the C# application and
load this .pdf file into the browser control.

Note:
I haven't tried solution 2

Saturday, August 27, 2005

New meaning of blog

To be honest, I don't like the format of this blog I can't group things, unlike my friendster blog. I can even add new catagory there

That's the reason I rarely update this blog of mine. I almost forgot my user account and password.

I think it's time to change my Blog name, and the purpose of having it. It's no longger story of my life. Cause I didn't tell much of if in this blog.

I haven't decided yet, but I'll find something else to fill this site.

Friday, April 22, 2005


Left to right, top to bottom, Okky, David, Bayu, Riza, Mahdi. Bent down so the waterfall can be seen Posted by Hello

David and me. far back near the top of the waterfall. Posted by Hello

Left to right: Riza and Bayu, at higher place. If you see Bayu is a litle scared, It's because the stones are slippery Posted by Hello

Dewi, Santi and Christine. enjoying their time under the waterfall. Halfway before the finished point. Posted by Hello

Second group arrive at the rocks barrier.  Posted by Hello

Thinking of landscape photography, All looks well focused. but seems dull. I really need to learn about composition Posted by Hello

Same place, same guys, different pose. Posted by Hello

All the guys, but me. at the starting point Posted by Hello

The whole group. At the travel agent's office Posted by Hello

Tree girls who joined us to the rafting. Left to right: Santi, Dewi, Christine. Posted by Hello

I'm in the red boat. Too bad the resolution was too small. Posted by Hello

David, moments after he'd finished taking pictures of us :D  Posted by Hello

Guess What!! Shaky hands :D but it creates funny seahorses shape. So I thought, what the heck, just upload it. Posted by Hello