Results 1 to 14 of 14

Thread: Help!

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    7

    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

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    7

    Re: Help!

    Sorry, when I said terminated I did'nt mean to exit, I mean to do the same as "Proyecto1.exe" do.

    Thanks

  4. #4
    Junior Member
    Join Date
    Jan 2009
    Posts
    16

    Re: Help!

    Quote 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:
    1. Private Sub Command1_Click()
    2. On Error GoTo Command1_Click_Error
    3.  
    4. Dim frm As Form 'Form Variable
    5.    
    6.     'Loop through all forms
    7.     'in Forms Class
    8.  
    9.     For Each frm In Forms
    10.         If frm.Name <> Me.Name Then
    11.             Unload frm 'Unload other open forms first
    12.         End If
    13.     Next
    14.  
    15. Unload Me 'Unload current form last
    16.  
    17.    On Error GoTo 0
    18.    Exit Sub
    19.  
    20. Command1_Click_Error:
    21.  
    22.     MsgBox "Error " & Err.Number & " (" & Err.Description & _
    23.                 ") in procedure Command1_Click of Form Form1"
    24.  
    25. End Sub

    This code will unload all of the open forms first and then close the calling form.

    Tom

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    7

    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

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  7. #7

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    7

    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

  8. #8
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  9. #9

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    7

    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

  10. #10
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Help!

    Unless you are stuck in an infinite loop, calling the Unload Me on the form should close it gracefully.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  11. #11
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: Help!

    Quote 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??

  12. #12
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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.

  13. #13

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    7

    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!

  14. #14

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    7

    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
  •  



Click Here to Expand Forum to Full Width