• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

How do I center an ActiveX dialog?

I embed an ActiveX object in an HTML page. The ActiveX object immediately opens an MFC dialog. I want to center this dialog.
The CenterWindow(NULL ) function in the code does not work, nor does writing CENTER before/after the OBJECT or SCRIPT tabs in the HTML.
My code looks like this:
<OBJECT
CLASSID='clsid:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
ID='MyObj'
></OBJECT>
<SCRIPT LANGUAGE="VBScript">
MyObj.Data="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
MyObj.DoSomething
</SCRIPT>

What should I do in order to center the AcitveX's dialog?
P.S. - the subsequent dialogs open in the center of the window - no problems here.
Thanks.
0
gilbert_chang
Asked:
gilbert_chang
  • 3
1 Solution
 
oubelkasCommented:
have you tried align="center" in the object tag? Not sure if it'll work though...

Joseph
0
 
gilbert_changAuthor Commented:
Does not work, But thanks anyway.
0
 
ahchongCommented:
<CENTER>
<OBJECT
CLASSID='clsid:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
ID='MyObj'
></OBJECT>
</CENTER>
<SCRIPT LANGUAGE="VBScript">
MyObj.Data="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
MyObj.DoSomething
</SCRIPT>


0
 
oubelkasCommented:
ahchong> read the question first before answering because gilbert said :

The CenterWindow(NULL ) function in the code does not work, nor does writing CENTER before/after the OBJECT or SCRIPT tabs in the HTML.

So <CENTER> </CENTER> doesn't work.

Gilbert > I last read an article which said what the properties of an object tag were, so here :

CLASSID - String specifying the identification number of the control. In a client-side browser environment the CLASSID numerals must be preceded with the text CLSID:
ALIGN:
TEXTTOP - top of the object aligned with top of current font
MIDDLE - middle of object aligned with baseline of text line
TEXTMIDDLE - middle of object aligned with middle of text line
BASELINE - bottom of object aligned with baseline of text line
TEXTBOTTOM - bottom of the object is aligned with bottom of the current font
LEFT - object aligned to the left of web page and the text will flow around the right side of the object
CENTER - object aligned in the center of the page and text will end the text line above the object and resume on the next text line down
RIGHT - opposite of left alignment
CODETYPE - specifies the Internet Media Type. This will save download time if the computer does not support a particular codetype.
DATA - contains the URL pointing to data required by the object. q
DECLARE - if this attribute is present, the browser will only load the object into memory and will not execute it until it is referenced.
HEIGHT / WIDTH - sets the height / width of the object in pixels
HSPACE - sets the amount of pixels on the left and right of the object that will pad the object.
VSPACE - Same as HSpace except this defines the pixels above and below the object.
ID - gives the object a document-wide identifier.
NAME - If you use an object in a form the browser will not consider the object as part of the form unless the object is given a name.
STANDBY - A string that will be displayed while the ActiveX control loads.
TYPE - Used to specify the Internet Media Type for the data specified by the DATA attribute.
USEMAP - specifies a URL for a client-side imagemap.

I'm sure my first comment must be the right one then...mmm, check it out.

Joseph
0
 
oubelkasCommented:
An example used in that article :

......
<OBJECT ID="fadeScroll" WIDTH=171 HEIGHT=21 ALIGN=CENTER
  CODEBASE="http://activex.microsoft.com/controls/mspert10.cab"
  CLASSID="CLSID:DFD181E0-5E2F-11CE-A449-00AA004A803D"
  STYLE="filter:Alpha(Opacity=100, FinishOpacity=100)">
......
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now