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
Printable View
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
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
Sorry, when I said terminated I did'nt mean to exit, I mean to do the same as "Proyecto1.exe" do.
Thanks
Without looking at your project I would add command button to a form with the following code:Quote:
Originally Posted by naish666
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
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
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.
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
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.
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
Unless you are stuck in an infinite loop, calling the Unload Me on the form should close it gracefully.
What is On Error GoTo 0? More specifically, where is 0?Quote:
Originally Posted by Thomas.Fredrickson
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.
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!
I only need to draw the points in the picturebox. Anybody knows how to do it, please?