CXCtrlMan ctrlman = m_Map.GetCtrlMan();
CXUIMan uiman = ctrlman.GetUIMan();
CXControlState ctrlstate = ctrlman.GetControlState();
CXSize dpsize = ctrlstate.GetSizeDP();
CXUtility util = m_Map.GetUtility();
long width_px = dpsize.GetCX()/2 - 250;
bPanel = uiman.CreateUI_Panel(uiman);
bPanel.SetParent(uiman);
bPanel.SetUIID(200);
bPanel.SetAlpha(80);
bPanel.SetBound(width_px, dpsize.GetCY()-450, 530, 150);
bPanel.SetCanDrag(1);
bPanel.SetCanClick(1);
bPanel.GetStretch();
bPanel.SetPen(util.GetConstToValue(_T("BS_SOLID")), 4, util.RGBColor(17, 168, 78));
bPanel.SetBrush(util.GetConstToValue(_T("BS_SOLID")), util.RGBColor(255, 255, 255), 0);
bPanel.SetAnchor(util.GetConstToValue(_T("TMUIOBJ_ANCHOR_BOTTOM")) | util.GetConstToValue(_T("TMUIOBJ_ANCHOR_HCENTER")));
bPanel.AddEventMode(util.GetConstToValue(_T("TMEVENTTYPE_MOUSELEAVE"))|
util.GetConstToValue(_T("TMEVENTTYPE_MOUSEENTER")));
CXImageMan imageman = ctrlman.GetImageMan();
imageman.SetDefaultPath(ctrlman.GetDefaultPath() + _T("\\Theme\\"));
CXUIButton btnZoomOut = uiman.CreateUI_Button(bPanel);
btnZoomOut.SetParent(bPanel);
btnZoomOut.SetUIID(1001);
btnZoomOut.SetCaption(_T("ZoomIn Button"));
btnZoomOut.SetBound(3, 3, 47, 45);
btnZoomOut.SetImageList(_T("Image\\UI\\btn_zoom_in.png"), 47, 45);
btnZoomOut.SetAnchor(util.GetConstToValue(_T("TMUIOBJ_ANCHOR_LEFT")) | util.GetConstToValue(_T("TMUIOBJ_ANCHOR_TOP")));
btnZoomOut.SetCanFocus(1);
btnZoomOut.SetCanClick(1);
btnZoomOut.SetBrush(util.GetConstToValue(_T("BS_SOLID")), util.RGBColor(255, 0, 0), 0);
btnZoomOut.SetTransparent(util.GetConstToValue(_T("TMUIOBJ_TRANSPARENT_ALL")));
btnZoomOut.SetCanDrag(1);
btnZoomOut.AddEventMode(util.GetConstToValue(_T("TMEVENTTYPE_MOUSEDOWN")) | util.GetConstToValue(_T("TMEVENTTYPE_MOUSEUP")));
btnZoomOut.SetEventMode(0);
btnZoomOut.SetLeft(10);
long bLeft = btnZoomOut.GetLeft();
AfxMessageBox(_T(" left %d"), bLeft);