Solved

create a form

Posted on 2002-03-28
6
173 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 200 total points
Comment Utility

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
Comment Utility
that code creates a new instance of an already existing form. anyother ways?
0
 
LVL 1

Expert Comment

by:CodeWizrd
Comment Utility

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:MikeNrsn
Comment Utility
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
Comment Utility
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
Comment Utility
Comment from expert accepted as answer

Computer101
E-E Admin
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now