Solved

create a form

Posted on 2002-03-28
6
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 1

Accepted Solution

by:
CodeWizrd earned 200 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

726 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