Package com.ms.activeX Previous
Previous
Contents
Contents
Index
Index
Next
Next

Class AXComponent

Constructors , Methods

public class AXComponent extends UICanvas {
  // Constructors
  public AXComponent();
  public AXComponent(String s);
  public AXComponent(IUnknown p);
  // Methods
  public synchronized void addNotify();
  public synchronized void removeNotify();
  public synchronized void reshape(int x, int y, int width, int height);
  public synchronized Dimension minimumSize();
  public synchronized Dimension preferredSize();
  public synchronized void setBackground(Color c);
  public synchronized void setForeground(Color c);
  public synchronized void show();
  public synchronized void hide();
  public synchronized void createControl(String s);
  public synchronized void createControl(IUnknown p);
  public synchronized IUnknown getObject();
  public void addAXComponentEventListener(AXComponentEventListener listener);
  public void removeAXComponentEventListener(AXComponentEventListener listener);
}

The AXComponent class is subclassed into a custom component or used for hosting a Microsoft® ActiveX™ control.


Constructors


AXComponent

public AXComponent();

Creates an empty AXComponent. You can then call createControl to host an ActiveX control.


AXComponent

public AXComponent(String s);

Creates an AXComponent that hosts a control.

ParameterDescription
s The class identifier (CLSID) of the control.


AXComponent

public AXComponent(IUnknown p);

Creates an AXComponent that hosts a control. The control that is hosted was already created, and the IUnknown of the control is used for all further communication.

ParameterDescription
p The COM identity of the control.


Methods


addAXComponentEventListener

public void addAXComponentEventListener(AXComponentEventListener listener);

Adds a listener.

Return Value:

No return value.

ParameterDescription
listener The listener that is added.


addNotify

public synchronized void addNotify();

Creates the control at notification time.

Return Value:

No return value.


createControl

public synchronized void createControl(String s);

Creates an AXComponent that hosts a control.

Return Value:

No return value.

ParameterDescription
s The CLSID of the control.


createControl

public synchronized void createControl(IUnknown p);

Creates an AXComponent that hosts a control. The control that is hosted was already created, and the IUnknown of the control is used for all further communication.

Return Value:

No return value.

ParameterDescription
p The IUnknown of the control.


getObject

public synchronized IUnknown getObject();

Returns the IUnknown of the ActiveX control. This is the object that you cast to your interface in order to call methods that reside in the control.

Return Value:

Returns the IUnknown of the ActiveX control.


hide

public synchronized void hide();

Hides a component.

Return Value:

No return value.


minimumSize

public synchronized Dimension minimumSize();

Queries an object to determine its minimum size (in pixels).

Return Value:

Returns an object's minimum size.


preferredSize

public synchronized Dimension preferredSize();

Queries an object to determine its preferred size (in pixels).

Return Value:

Returns an object's preferred size.


removeAXComponentEventListener

public void removeAXComponentEventListener(AXComponentEventListener listener);

Removes a listener.

Return Value:

No return value.

ParameterDescription
listener The listener that is removed.


removeNotify

public synchronized void removeNotify();

Performs all the OLE cleanup associated with an ActiveX control.

Return Value:

No return value.


reshape

public synchronized void reshape(int x, int y, int width, int height);

Notifies the control of the control's new size.

Return Value:

No return value.

ParameterDescription
x The control's starting x coordinate.
y The control's starting y coordinate.
width The control's new horizontal dimension (in pixels).
height The control's new vertical dimension (in pixels).


setBackground

public synchronized void setBackground(Color c);

Instructs the control to set its background color.

Return Value:

No return value.

ParameterDescription
c The background color that is set.


setForeground

public synchronized void setForeground(Color c);

Instructs the control to set its foreground color.

Return Value:

No return value.

ParameterDescription
c The foreground color that is set.


show

public synchronized void show();

Makes the control visible.

Return Value:

No return value.



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.