Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

create a form

Posted on 2002-03-28
6
Medium Priority
?
200 Views
Last Modified: 2010-05-02
I would like to programatically create a form and label in a module, and center the label in the module? Can anyone get my started?

I am trying to write a module that create a message popup similar to WindowsMessanger's popup. The one that says "So-and-so has just signed on." that slides up above your system tray.

I want to say Message("Welcome to my program") and have that as the label.

Im not asking you to write this for me. I just need to know how and if you can create  form 100% programatically. Thanks.
0
Comment
Question by:MikeNrsn
6 Comments
 
LVL 1

Accepted Solution

by:
CodeWizrd earned 800 total points
ID: 6904346

How about this:

http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=31928&lngWId=1

This is sample code on how to create a form dynamically and put controls on it.

As far as centering the textbox, just use a math formula to figure out where to put it.

For example:

label.top = (form.height - label.height) / 2
label.left = (form.width - label.width) / 2

That will center your label in the form you created.

0
 

Author Comment

by:MikeNrsn
ID: 6908288
that code creates a new instance of an already existing form. anyother ways?
0
 
LVL 1

Expert Comment

by:CodeWizrd
ID: 6908961

On the few occasions that I have had to do this, I have created a dummy form in the project and left it generic.  This way, you have a "template" of what the form will look like when you create the instance, and can manipulate it from there.

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:MikeNrsn
ID: 6909235
Thats true, I know how to do that and that is kind of what I am trying to avoid doing.  Do you know how to write pixle by pixle to the screen. I guess I could do it that way also.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7637960
Hi MikeNrsn,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept CodeWizrd's comment(s) as an answer.

MikeNrsn, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 8092506
Comment from expert accepted as answer

Computer101
E-E Admin
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question