form editing

A

art

Hi,

Just to let you know I am new to vbasic for starters.
Can I build forms without the gui ide tool. I just want to code simple
forms and just dont like the overhead of a big tool. I was able to do
this in another scripting language.

Cheers,
Art

ps. Here is what the other language looked like.

toplevel. .tl
frame .tl..f
button .tl.f.b -text go -command doThis

proc doThis {} {puts "you did this"}
 
G

G-Money

In the Visual Basic Editor you can right click on a form in the
Project Explorer window and export the form to a text file format. I
have never built forms entirely in the text file. I usually make one
of each item in the GUI and then use the text file to do mass changes.
 
A

art

Hi G-Money,

From what I can tell the export puts out 2 files, ,frm and frx when
the form in explorer window is highlighted. When the main document is
highlighted it exports a cls file. The form exports look promising
except that the frx file is a binary file, while the frm file is text
and appears to be the subroutine call backs to handle the widgets. So
I dont think I can get at the source of created the widgets.

thanks,
Art
 
A

Aussie Susan

Art,

I have dome something similar to this: in my case I used the IDE to
construct the form itself and a multi-page tab control within the form. I
then dynamically added the pages to the tab control and the fields and
buttons within that page.

It leads to a lot of code that looks a bit like:

' Create the new page
Set OurPage = MyBaseControl.Pages.Add(, SectionName)
OurPage.Tag = OurPage.Index

' Now start adding the controls
Set lblHeader = OurPage.Controls.Add("Forms.Label.1", "lblHeader")
With lblHeader
.Top = 12
.Left = 6
.Height = 12
.Width = 57
.Caption = "Table Entries"
.Font.Size = 10
.AutoSize = True
End With
Set cmdNewEntry = OurPage.Controls.Add("Forms.CommandButton.1",
"cmdNewEntry")
With cmdNewEntry
.Top = 6
.Left = 348
.Width = 20
.Height = 20
.PicturePosition = 7
.Caption = "+"
.Font.Size = 10
End With

Unless your really need to dynamically create the form, then I would
recommend using the IDE. The 'big tool' part impacts the development of the
form and not the run-time (with VBA they are rather inter-twined) as the .frx
file (visible when you export the form) is really a binary representation of
your file that the runtime has to process anyway.

Based on your example, would the MsgBox and InputBox functions surfice?

Susan
 
A

art

Susan,

I used a portion of your example to test what you said. It will do
the job nicely. I guess I sometimes have an aversion to learn a big
tool even though they are meant to be helpful. It looks like this one
is more friendly than I have given it credit for. I probably will need
more then the MsgBox and InputBox so I'll use the IDE.

thanks,
Art
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top