Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / December 2006



Tip: Looking for answers? Try searching our database.

Form properties

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chuck - 09 Dec 2006 20:17 GMT
Using VB6 Enterprise Edition.

Is 'Cancel' supposed to be a from property?
It is supposed to close a form by pushing <Esc> if set to true.

Chuck
--
Steve Gerrard - 09 Dec 2006 22:44 GMT
> Using VB6 Enterprise Edition.
>
[quoted text clipped - 3 lines]
> Chuck
> --

No, but you can set the Cancel property of a command button to True. This means
it is "clicked" when the user presses escape. On modal dialogs particularly, you
often set the Enter property true on the OK button, and the Cancel property true
on the Cancel button. Then pressing escape has the same effect as clicking the
Cancel button. You get to write the code for the Cancel button, which is usually
to close the form without saving changes.
Jan Hyde - 11 Dec 2006 08:43 GMT
Chuck <libbeyc@schoollink.net>'s wild thoughts were released
on Sat, 09 Dec 2006 15:17:43 -0500 bearing the following
fruit:

>Using VB6 Enterprise Edition.
>
>Is 'Cancel' supposed to be a from property?
>It is supposed to close a form by pushing <Esc> if set to true.

It is in VB.Net but not with VB6 and below, where you set
the cancel property of a command button.

Jan Hyde (VB MVP)

Signature

When ancient wall sculptors were finished, it was a relief. (David Kahn)

Chuck - 11 Dec 2006 12:19 GMT
>Using VB6 Enterprise Edition.
>
>Is 'Cancel' supposed to be a from property?
>It is supposed to close a form by pushing <Esc> if set to true.
>
>Chuck
Thanks Steve and Jan.  I'm new to windows programming.  The last time I wrote a
program it was in Pascal and DOS 3 was king.  What I'm trying to do is
translate a program written in BASIC about 1990 to Visual Basic.  I want an
opening screen that gives credit to the original programmer and to several
other people who made modifications over the years.  The program runs just fine
in a DOS Window.  However if you click to have a hard copy of the output data,
the program looks for a DOS printer connected to the LPT1 port.  All I want to
do is make it print to a Windows printer connected to a USB port.  I am not
going to change to functioning of the program.

Chuck
--
J French - 11 Dec 2006 14:11 GMT
>>Using VB6 Enterprise Edition.
>>
[quoted text clipped - 11 lines]
>do is make it print to a Windows printer connected to a USB port.  I am not
>going to change to functioning of the program.

Print to a file and get a 10 line Windows App to shunt it into the
spooler.
Chuck - 12 Dec 2006 12:00 GMT
>>>Using VB6 Enterprise Edition.
>>>
[quoted text clipped - 14 lines]
>Print to a file and get a 10 line Windows App to shunt it into the
>spooler.

When the BASIC program runs, it is in a DOS window.
Does the *shunt* occur within the BASIC program?
In the past I've made DOS programs print to a file.  Then when the program
closes I open the file and print.  A little akward if making multiple runs.
J French - 12 Dec 2006 13:27 GMT
<snip>

>>Print to a file and get a 10 line Windows App to shunt it into the
>>spooler.

>When the BASIC program runs, it is in a DOS window.
>Does the *shunt* occur within the BASIC program?
>In the past I've made DOS programs print to a file.  Then when the program
>closes I open the file and print.  A little akward if making multiple runs.

You should be able to kick off a Windows App from VB, the App does not
need to be visible.

I'm sure that there are plenty of utilities out there, if not someone
would run one up for you, it is about 10 mins work.

I used to print to LPT1 directly using Int 17h  (well my code still
does) but with the plethora of printers out there nowadays it is
probably better to go for something structured and generic.
Chuck - 13 Dec 2006 03:51 GMT
>>Using VB6 Enterprise Edition.
>>
[quoted text clipped - 13 lines]
>
>Chuck
Finally got what I want.  added  code at the very top of the data input form:
 Private Sub Form Load ()
   MsgBox"......." & Chr$(13) & "......")
 End Sub

Notice the Chr$(13) for line feed.  The VB6 book that I have shows Chr(13)
without the $.  If the $ is left our there is a compile error.

The message doesn't fill the whole screen, but it looks good and is centered
nicely.  There are 14 lines of text and the box has an OK button that closes
the message box and opens the data input form.

Is it possible to format only the first line of text to a larger font and make
it bold?  

Chuck
--
Steve Gerrard - 13 Dec 2006 17:06 GMT
> Finally got what I want.  added  code at the very top of the data input form:
>  Private Sub Form Load ()
[quoted text clipped - 3 lines]
> Notice the Chr$(13) for line feed.  The VB6 book that I have shows Chr(13)
> without the $.  If the $ is left our there is a compile error.

I would have written
   "......." & vbCrLf & "......")

vbCrLf is a pre-defined constant that puts a carriage return and line feed into
a string.

> The message doesn't fill the whole screen, but it looks good and is centered
> nicely.  There are 14 lines of text and the box has an OK button that closes
> the message box and opens the data input form.
>
> Is it possible to format only the first line of text to a larger font and make
> it bold?

You can just create your own message form, with whatever properties you need,
including a one line label in bold followed by a multi-line label in regular.

To run it, I would change your project to start with Sub Main, and then in a
module write

Sub Main()
   MsgForm.Show vbModal
   ' vbModal = code stops and waits for form to close...
   FormMain.Show
End Sub
Chuck - 14 Dec 2006 13:10 GMT
>> Finally got what I want.  added  code at the very top of the data input form:
>>  Private Sub Form Load ()
[quoted text clipped - 28 lines]
>    FormMain.Show
>End Sub

Thanks Steve.

I don't understand exactly what you'r telling me, but I'm going to play around
with it and see what I can do.  I'll get back and let you know what happens.

Chuck
--
Chuck - 26 Dec 2006 15:09 GMT
Beginning to understand a little, very little.
I don't think I've installed VB6 completely.
Added "Microsoft Windows Common Controls 6.0" to the controls window
Added toolbar to top of form.
Under Properties Pages/General
Image List drop down box does not have any choices other than "None"
I have VB6 Enterprise Edition.
When VB6 was installed, 'select all' was chosen for components to install.
Obviously something else needs to be done.

Suggestions please.

Chuck
--
Chuck - 28 Dec 2006 13:27 GMT
Solved.  And all I had to do was RTFM.

>Beginning to understand a little, very little.
>I don't think I've installed VB6 completely.
[quoted text clipped - 9 lines]
>
>Chuck
Steve Gerrard - 28 Dec 2006 15:39 GMT
> Solved.  And all I had to do was RTFM.

Yes, but the instruction to RTFM is found on page 4, so not everyone gets
there...:)
Chuck - 28 Dec 2006 16:46 GMT
>> Solved.  And all I had to do was RTFM.
>
>Yes, but the instruction to RTFM is found on page 4, so not everyone gets
>there...:)

Amen
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.