exskinbox - sample code

How can I display a message box that closes automatically?

VBA (MS Access, Excell...)

With MsgBox1
	.AutoClose = 5
	.Out "This is a message that's going to close in <b><%sec%></b> seconds.",,"Information"
End With

VB6

With MsgBox1
	.AutoClose = 5
	.Out "This is a message that's going to close in <b><%sec%></b> seconds.",,"Information"
End With

VB.NET

With Exmsgbox1
	.AutoClose = 5
	.Out("This is a message that's going to close in <b><%sec%></b> seconds.",,"Information")
End With

VB.NET for /COM

With AxMsgBox1
	.AutoClose = 5
	.Out("This is a message that's going to close in <b><%sec%></b> seconds.",,"Information")
End With

C++

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSKINBOXLib' for the library: 'ExSkinBox 1.0 Control Library'

	#import <ExSkinBox.dll>
	using namespace EXSKINBOXLib;
*/
EXSKINBOXLib::IMsgBoxPtr spMsgBox1 = GetDlgItem(IDC_MSGBOX1)->GetControlUnknown();
spMsgBox1->PutAutoClose(5);
spMsgBox1->Out(L"This is a message that's going to close in <b><%sec%></b> seconds.",vtMissing,"Information",vtMissing,vtMissing,vtMissing);

C++ Builder

MsgBox1->AutoClose = 5;
MsgBox1->Out(L"This is a message that's going to close in <b><%sec%></b> seconds.",TNoParam(),TVariant("Information"),TNoParam(),TNoParam(),TNoParam());

C#

exmsgbox1.AutoClose = 5;
exmsgbox1.Out("This is a message that's going to close in <b><%sec%></b> seconds.",null,"Information",null,null,null);

JScript/JavaScript

<BODY onload="Init()">
<OBJECT CLASSID="clsid:6BBB0912-B723-4B47-A806-B529336D81B9" id="MsgBox1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
	MsgBox1.AutoClose = 5;
	MsgBox1.Out("This is a message that's going to close in <b><%sec%></b> seconds.",null,"Information",null,null,null);
}
</SCRIPT>
</BODY>

VBScript

<BODY onload="Init()">
<OBJECT CLASSID="clsid:6BBB0912-B723-4B47-A806-B529336D81B9" id="MsgBox1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
	With MsgBox1
		.AutoClose = 5
		.Out "This is a message that's going to close in <b><%sec%></b> seconds.",,"Information"
	End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axMsgBox1.AutoClose = 5;
axMsgBox1.Out("This is a message that's going to close in <b><%sec%></b> seconds.",null,"Information",null,null,null);

X++ (Dynamics Ax 2009)

public void init()
{
	;

	super();

	exmsgbox1.AutoClose(5);
	exmsgbox1.Out("This is a message that's going to close in <b><%sec%></b> seconds.",,"Information");
}

Delphi 8 (.NET only)

with AxMsgBox1 do
begin
	AutoClose := 5;
	Out('This is a message that''s going to close in <b><%sec%></b> seconds.',Nil,'Information',Nil,Nil,Nil);
end

Delphi (standard)

with MsgBox1 do
begin
	AutoClose := 5;
	Out('This is a message that''s going to close in <b><%sec%></b> seconds.',Null,'Information',Null,Null,Null);
end

VFP

with thisform.MsgBox1
	.AutoClose = 5
	.Out("This is a message that's going to close in <b><%sec%></b> seconds.",Null,"Information")
endwith

dBASE Plus

local oMsgBox

oMsgBox = form.EXSKINBOXACTIVEXCONTROL1.nativeObject
oMsgBox.AutoClose = 5
oMsgBox.Out("This is a message that's going to close in <b><%sec%></b> seconds.",null,"Information")

XBasic (Alpha Five)

Dim oMsgBox as P

oMsgBox = topparent:CONTROL_ACTIVEX1.activex
oMsgBox.AutoClose = 5
oMsgBox.Out("This is a message that's going to close in <b><%sec%></b> seconds.",,"Information")

Visual Objects


oDCOCX_Exontrol1:AutoClose := 5
oDCOCX_Exontrol1:Out("This is a message that's going to close in <b><%sec%></b> seconds.",nil,"Information",nil,nil,nil)

PowerBuilder

OleObject oMsgBox

oMsgBox = ole_1.Object
oMsgBox.AutoClose = 5
oMsgBox.Out("This is a message that's going to close in <b><%sec%></b> seconds.",,"Information")

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Set ComAutoClose to 5
	Get ComOut "This is a message that's going to close in <b><%sec%></b> seconds." "Information" Nothing Nothing Nothing to Nothing
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oMsgBox

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oMsgBox := XbpActiveXControl():new( oForm:drawingArea )
	oMsgBox:CLSID  := "Exontrol.MsgBox.1" /*{6BBB0912-B723-4B47-A806-B529336D81B9}*/
	oMsgBox:create(,, {10,60},{610,370} )

		oMsgBox:AutoClose := 5
		oMsgBox:Out("This is a message that's going to close in <b><%sec%></b> seconds.",,"Information")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN