Print Page | Close Window

Using PopupControl as a message box replacement

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=7996
Printed Date: 16 November 2024 at 9:55pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Using PopupControl as a message box replacement
Posted By: eugene_v
Subject: Using PopupControl as a message box replacement
Date Posted: 13 September 2007 at 11:40am

Good day everyone!

Has anyone tried using the PopupControl as a less annoying replacement for a message box under VB6?

PopupControl seems to have .Right property that doesn't allow it to be displayed centered to a form, for example.

Do you think it is possible to display the PopupControl centered to a form?


-------------
Eugene V
A happy registered user of Xtreme SuitePro 2007 11.2.0 with VB6



Replies:
Posted By: Oleg
Date Posted: 13 September 2007 at 12:02pm
Hi,
You know size of Popup, you know Size and position of Form, don't see why you can't calculate Right property to make it centered.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: eugene_v
Date Posted: 13 September 2007 at 1:40pm
Originally posted by oleg oleg wrote:

Hi,
You know size of Popup, you know Size and position of Form, don't see why you can't calculate Right property to make it centered.
 
You are correct! It didn't seam to work because VB uses Twips and Popup uses pixes.
 
Here is how to center your popup on a form and
use it as a message box replacement:
 

 
Popup.Right = Me.ScaleX(Me.Left + (Me.Width / 2), vbTwips, vbPixels) + (Popup.Width / 2)
Popup.Bottom = Me.ScaleY(Me.Top + (Me.Height / 2), vbTwips, vbPixels) + (Popup.Height / 2)
 


-------------
Eugene V
A happy registered user of Xtreme SuitePro 2007 11.2.0 with VB6



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net