create a form

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.
MikeNrsnAsked:
Who is Participating?
 
CodeWizrdCommented:

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
 
MikeNrsnAuthor Commented:
that code creates a new instance of an already existing form. anyother ways?
0
 
CodeWizrdCommented:

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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
MikeNrsnAuthor Commented:
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
 
DanRollinsCommented:
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
 
Computer101Commented:
Comment from expert accepted as answer

Computer101
E-E Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.