exstatusbar - sample code |
How can I display a percent or a progress-bar inside the panel? VBA (MS Access, Excell...) With StatusBar1 .BeginUpdate .VisualAppearance.Add 4,"c:\exontrol\images\border.ebn" .VisualAppearance.Add 5,"CP:4 1 1 -1 -1" .BackColorPanels = &H5000000 .BackColor = &H8000000f .Format = "1/2,(24;5/6)" With .Panel(5) .Text = "15%" .Percent = 15 End With .EndUpdate End With VB6 With StatusBar1 .BeginUpdate .VisualAppearance.Add 4,"c:\exontrol\images\border.ebn" .VisualAppearance.Add 5,"CP:4 1 1 -1 -1" .BackColorPanels = &H5000000 .BackColor = &H8000000f .Format = "1/2,(24;5/6)" With .Panel(5) .Text = "15%" .Percent = 15 End With .EndUpdate End With VB.NET With Exstatusbar1 .BeginUpdate() .VisualAppearance.Add(4,"c:\exontrol\images\border.ebn") .VisualAppearance.Add(5,"CP:4 1 1 -1 -1") .BackColorPanels32 = &H5000000 .BackColor32 = &H8000000f .Format = "1/2,(24;5/6)" With .get_Panel(5) .Text = "15%" .Percent = 15 End With .EndUpdate() End With VB.NET for /COM With AxStatusBar1 .BeginUpdate() .VisualAppearance.Add(4,"c:\exontrol\images\border.ebn") .VisualAppearance.Add(5,"CP:4 1 1 -1 -1") .GetOcx().BackColorPanels = &H5000000 .GetOcx().BackColor = &H8000000f .Format = "1/2,(24;5/6)" With .get_Panel(5) .Text = "15%" .Percent = 15 End With .EndUpdate() End With C++ /* Copy and paste the following directives to your header file as it defines the namespace 'EXSTATUSBARLib' for the library: 'ExStatusBar 1.0 Control Library' #import <ExStatusBar.dll> using namespace EXSTATUSBARLib; */ EXSTATUSBARLib::IStatusBarPtr spStatusBar1 = GetDlgItem(IDC_STATUSBAR1)->GetControlUnknown(); spStatusBar1->BeginUpdate(); spStatusBar1->GetVisualAppearance()->Add(4,"c:\\exontrol\\images\\border.ebn"); spStatusBar1->GetVisualAppearance()->Add(5,"CP:4 1 1 -1 -1"); spStatusBar1->PutBackColorPanels(0x5000000); spStatusBar1->PutBackColor(0x8000000f); spStatusBar1->PutFormat(L"1/2,(24;5/6)"); EXSTATUSBARLib::IPanelPtr var_Panel = spStatusBar1->GetPanel(long(5)); var_Panel->PutText(L"15%"); var_Panel->PutPercent(15); spStatusBar1->EndUpdate(); C++ Builder StatusBar1->BeginUpdate(); StatusBar1->VisualAppearance->Add(4,TVariant("c:\\exontrol\\images\\border.ebn")); StatusBar1->VisualAppearance->Add(5,TVariant("CP:4 1 1 -1 -1")); StatusBar1->BackColorPanels = 0x5000000; StatusBar1->BackColor = 0x8000000f; StatusBar1->Format = L"1/2,(24;5/6)"; Exstatusbarlib_tlb::IPanelPtr var_Panel = StatusBar1->Panel[TVariant(5)]; var_Panel->Text = L"15%"; var_Panel->Percent = 15; StatusBar1->EndUpdate(); C# exstatusbar1.BeginUpdate(); exstatusbar1.VisualAppearance.Add(4,"c:\\exontrol\\images\\border.ebn"); exstatusbar1.VisualAppearance.Add(5,"CP:4 1 1 -1 -1"); exstatusbar1.BackColorPanels32 = 0x5000000; exstatusbar1.BackColor32 = 0x8000000f; exstatusbar1.Format = "1/2,(24;5/6)"; exontrol.EXSTATUSBARLib.Panel var_Panel = exstatusbar1.get_Panel(5); var_Panel.Text = "15%"; var_Panel.Percent = 15; exstatusbar1.EndUpdate(); JavaScript <OBJECT classid="clsid:0885027A-DF96-481F-928C-E3E3788889BA" id="StatusBar1"></OBJECT> <SCRIPT LANGUAGE="JScript"> StatusBar1.BeginUpdate(); StatusBar1.VisualAppearance.Add(4,"c:\\exontrol\\images\\border.ebn"); StatusBar1.VisualAppearance.Add(5,"CP:4 1 1 -1 -1"); StatusBar1.BackColorPanels = 83886080; StatusBar1.BackColor = -2147483633; StatusBar1.Format = "1/2,(24;5/6)"; var var_Panel = StatusBar1.Panel(5); var_Panel.Text = "15%"; var_Panel.Percent = 15; StatusBar1.EndUpdate(); </SCRIPT> C# for /COM axStatusBar1.BeginUpdate(); axStatusBar1.VisualAppearance.Add(4,"c:\\exontrol\\images\\border.ebn"); axStatusBar1.VisualAppearance.Add(5,"CP:4 1 1 -1 -1"); (axStatusBar1.GetOcx() as EXSTATUSBARLib.StatusBar).BackColorPanels = 0x5000000; (axStatusBar1.GetOcx() as EXSTATUSBARLib.StatusBar).BackColor = 0x8000000f; axStatusBar1.Format = "1/2,(24;5/6)"; EXSTATUSBARLib.Panel var_Panel = axStatusBar1.get_Panel(5); var_Panel.Text = "15%"; var_Panel.Percent = 15; axStatusBar1.EndUpdate(); X++ (Dynamics Ax 2009) public void init() { COM com_Panel; anytype var_Panel; ; super(); exstatusbar1.BeginUpdate(); exstatusbar1.VisualAppearance().Add(4,"c:\\exontrol\\images\\border.ebn"); exstatusbar1.VisualAppearance().Add(5,"CP:4 1 1 -1 -1"); exstatusbar1.BackColorPanels(0x5000000); exstatusbar1.BackColor(0x8000000f); exstatusbar1.Format("1/2,(24;5/6)"); var_Panel = exstatusbar1.Panel(COMVariant::createFromInt(5)); com_Panel = var_Panel; com_Panel.Text("15%"); com_Panel.Percent(15); exstatusbar1.EndUpdate(); } Delphi 8 (.NET only) with AxStatusBar1 do begin BeginUpdate(); VisualAppearance.Add(4,'c:\exontrol\images\border.ebn'); VisualAppearance.Add(5,'CP:4 1 1 -1 -1'); (GetOcx() as EXSTATUSBARLib.StatusBar).BackColorPanels := $5000000; (GetOcx() as EXSTATUSBARLib.StatusBar).BackColor := $8000000f; Format := '1/2,(24;5/6)'; with get_Panel(TObject(5)) do begin Text := '15%'; Percent := 15; end; EndUpdate(); end Delphi (standard) with StatusBar1 do begin BeginUpdate(); VisualAppearance.Add(4,'c:\exontrol\images\border.ebn'); VisualAppearance.Add(5,'CP:4 1 1 -1 -1'); BackColorPanels := $5000000; BackColor := $8000000f; Format := '1/2,(24;5/6)'; with Panel[OleVariant(5)] do begin Text := '15%'; Percent := 15; end; EndUpdate(); end VFP with thisform.StatusBar1 .BeginUpdate .VisualAppearance.Add(4,"c:\exontrol\images\border.ebn") .VisualAppearance.Add(5,"CP:4 1 1 -1 -1") .BackColorPanels = 0x5000000 .BackColor = 0x8000000f .Format = "1/2,(24;5/6)" with .Panel(5) .Text = "15%" .Percent = 15 endwith .EndUpdate endwith dBASE Plus local oStatusBar,var_Panel oStatusBar = form.Activex1.nativeObject oStatusBar.BeginUpdate() oStatusBar.VisualAppearance.Add(4,"c:\exontrol\images\border.ebn") oStatusBar.VisualAppearance.Add(5,"CP:4 1 1 -1 -1") oStatusBar.BackColorPanels = 0x5000000 oStatusBar.BackColor = 0x8000000f oStatusBar.Format = "1/2,(24;5/6)" var_Panel = oStatusBar.Panel(5) var_Panel.Text = "15%" var_Panel.Percent = 15 oStatusBar.EndUpdate() XBasic (Alpha Five) Dim oStatusBar as P Dim var_Panel as P oStatusBar = topparent:CONTROL_ACTIVEX1.activex oStatusBar.BeginUpdate() oStatusBar.VisualAppearance.Add(4,"c:\exontrol\images\border.ebn") oStatusBar.VisualAppearance.Add(5,"CP:4 1 1 -1 -1") oStatusBar.BackColorPanels = 83886080 oStatusBar.BackColor = -2147483633 oStatusBar.Format = "1/2,(24;5/6)" var_Panel = oStatusBar.Panel(5) var_Panel.Text = "15%" var_Panel.Percent = 15 oStatusBar.EndUpdate() Visual Objects local var_Panel as IPanel oDCOCX_Exontrol1:BeginUpdate() oDCOCX_Exontrol1:VisualAppearance:Add(4,"c:\exontrol\images\border.ebn") oDCOCX_Exontrol1:VisualAppearance:Add(5,"CP:4 1 1 -1 -1") oDCOCX_Exontrol1:BackColorPanels := 0x5000000 oDCOCX_Exontrol1:BackColor := 0x8000000f oDCOCX_Exontrol1:Format := "1/2,(24;5/6)" var_Panel := oDCOCX_Exontrol1:[Panel,5] var_Panel:Text := "15%" var_Panel:Percent := 15 oDCOCX_Exontrol1:EndUpdate() PowerBuilder OleObject oStatusBar,var_Panel oStatusBar = ole_1.Object oStatusBar.BeginUpdate() oStatusBar.VisualAppearance.Add(4,"c:\exontrol\images\border.ebn") oStatusBar.VisualAppearance.Add(5,"CP:4 1 1 -1 -1") oStatusBar.BackColorPanels = 83886080 /*0x5000000*/ oStatusBar.BackColor = -2147483633 /*0x8000000f*/ oStatusBar.Format = "1/2,(24;5/6)" var_Panel = oStatusBar.Panel(5) var_Panel.Text = "15%" var_Panel.Percent = 15 oStatusBar.EndUpdate() Visual DataFlex
XBase++ #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oPanel LOCAL oStatusBar oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oStatusBar := XbpActiveXControl():new( oForm:drawingArea ) oStatusBar:CLSID := "Exontrol.StatusBar.1" /*{0885027A-DF96-481F-928C-E3E3788889BA}*/ oStatusBar:create(,, {10,60},{610,370} ) oStatusBar:BeginUpdate() oStatusBar:VisualAppearance():Add(4,"c:\exontrol\images\border.ebn") oStatusBar:VisualAppearance():Add(5,"CP:4 1 1 -1 -1") oStatusBar:BackColorPanels := 0x5000000 oStatusBar:BackColor := 0x8000000f oStatusBar:Format := "1/2,(24;5/6)" oPanel := oStatusBar:Panel(5) oPanel:Text := "15%" oPanel:Percent := 15 oStatusBar:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |