|
-
Jan 27th, 2009, 12:52 PM
#1
Thread Starter
New Member
Help!
I'm doing a project for learning VB. My project must do the same as the file called "Proyecto1.exe" in the "example" folder of the file link bellow.
Here
Could anyone help me to terminate my project, please?
Thanks
-
Jan 27th, 2009, 12:58 PM
#2
Re: Help!
Welcome to the forums.
The FAQ section of this forum has some great info. Including proper ways of terminating/closing your own application. Here is that link. Let us know if you have any problems and exactly what went wrong.
Cheers
-
Jan 27th, 2009, 01:03 PM
#3
Thread Starter
New Member
Re: Help!
Sorry, when I said terminated I did'nt mean to exit, I mean to do the same as "Proyecto1.exe" do.
Thanks
-
Jan 27th, 2009, 01:14 PM
#4
Junior Member
Re: Help!
 Originally Posted by naish666
. . . escargas/p11.zip"]Here[/URL]
Could anyone help me to terminate my project, please?
Thanks
Without looking at your project I would add command button to a form with the following code:
VB Code:
Private Sub Command1_Click()
On Error GoTo Command1_Click_Error
Dim frm As Form 'Form Variable
'Loop through all forms
'in Forms Class
For Each frm In Forms
If frm.Name <> Me.Name Then
Unload frm 'Unload other open forms first
End If
Next
Unload Me 'Unload current form last
On Error GoTo 0
Exit Sub
Command1_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & _
") in procedure Command1_Click of Form Form1"
End Sub
This code will unload all of the open forms first and then close the calling form.
Tom
-
Jan 27th, 2009, 01:41 PM
#5
Thread Starter
New Member
Re: Help!
Thanks for the code, I'll include in my project, but the problem is that I need to do the sames as "Proyecto1.exe" do, and I can do it.
Any help!
Thanks
-
Jan 27th, 2009, 01:48 PM
#6
Re: Help!
You might want to give an example or explain what Proyecto1 does that your project does not do. Be exact please.
Looking at the other project, it closes when a user hits a button click. The code simply calls End which terminates the application immediately. Using End is not recommended and is a poor choice to closing the application. The link I gave you in post #2 explains how to properly close your application.
Last edited by LaVolpe; Jan 27th, 2009 at 02:03 PM.
-
Jan 27th, 2009, 02:05 PM
#7
Thread Starter
New Member
Re: Help!
Thanks again.
The file "Proyecto1.exe" is for paint dots of differents colours and sizes.
First you have to select the amount of Red ("Rojo"), Green ("Verde") and Blue ("Azul") from the respectives scrollings. Then you have to select the size of the dot ("Grosor Punto") int the scroll. Then you go to "HERRAMIENTAS"/"ESTABLECER ORIGEN", it opens a from where you have to input Xmax, Xmin, Ymax and Ymin to define coordinates of the space to paint. Whit this you can draw points in the picturebox and the coordinates will appear in the textboxes ("Coordenada X" and "Coordenada Y") . The other option ("DIBUJAR EJES") is only accesible after you entered the coordinates in (Xmax, Xmin, Ymax, ymin).
Then you can draw dots or enter the coordinates (X and Y) in the boxes ("Coordenada X" and "Coordenada Y") and then click on "DIBUJAR PUNTO".
Thanks
-
Jan 27th, 2009, 02:09 PM
#8
Re: Help!
We would be more than happy to help, but you still have not explained what your application cannot do that the other application does. Since the source code was provided with Proyecto1, simply extract it from the zip file, open the project, and learn from that code.
I am sorry, but I do not understand if there is a problem and what that problem is. I do not understand exactly what you are asking from us.
-
Jan 27th, 2009, 02:18 PM
#9
Thread Starter
New Member
Re: Help!
I don't know how to draw the points and show the coordinates on the boxes.
I can set the colours and de size of the point, but can't draw them.
Thanks
-
Jan 27th, 2009, 02:20 PM
#10
Re: Help!
Unless you are stuck in an infinite loop, calling the Unload Me on the form should close it gracefully.
-
Jan 27th, 2009, 04:14 PM
#11
Re: Help!
 Originally Posted by Thomas.Fredrickson
On Error GoTo 0
Exit Sub
Command1_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & _
") in procedure Command1_Click of Form Form1"
End Sub
What is On Error GoTo 0? More specifically, where is 0?
<--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
If topic has been resolved, please pull down the Thread Tools & mark it Resolved.
Is VB consuming your life, and is that a bad thing?? 
-
Jan 27th, 2009, 05:09 PM
#12
Re: Help!
There is no 0, it just disables error handling in that routine - however, there is no need to do it just before exiting the routine, as the error handling becomes disabled as the routine exits anyway.
-
Jan 28th, 2009, 01:00 AM
#13
Thread Starter
New Member
Re: Help!
I am been trying to do the same as "Proyecto11.exe" do and I can't do it.
When I chage the "Origen coordenadas" I can't draw the dots on the picturebox.
Here you have the last file with my code.
Please help me!
-
Jan 28th, 2009, 07:36 AM
#14
Thread Starter
New Member
Re: Help!
I only need to draw the points in the picturebox. Anybody knows how to do it, please?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|