Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Application Closing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Application Closing

    Is there anyway to force the user to close the application via a button. I've spent hours trying to figure this out,nothing seems to work. I have a log off button on a main menu form. The form is the start up form which is max within the alpha window. I have tried placing code on the candatabaseclose event with no success. Is there anyway of disabaling or removing the X in the alpha window?

    Brian

    #2
    RE: Application Closing

    " I have tried placing code on the candatabaseclose event with no success." - and that code is......?
    There can be only one.

    Comment


      #3
      RE: Application Closing

      You might want to try this in your autoexec script

      dim code as C
      dim flag as L
      flag = .F.
      code = ""%code%
      if .not. flag
      CANCEL()
      end if
      %code%
      can_database_exit(code)

      Then have your button set the flag to true before executing the exit cose.

      But I've not purchased V6 yet so I can't test it.
      There can be only one.

      Comment


        #4
        RE: Application Closing

        Hello Stan,

        I apologize for not responding quicker. I got caught up working on something else. And I would like to thank you for responding quickly. I've tried a number of different things at the moment I have the following just trying to get it to work:

        cancel()
        ui_beep(UI_EXCLAMATION_BEEP)
        ui_msg_box("Log Off","You must log off to close")

        The weird thing is if I have the form closed and try to close the application It fires like it is supposed to???
        It also works if I close the mainmenu form and open a different form from the control panel?? When I do this the form closes bringing me to the contol panel but I am unable to open another form, a hour glass appears with no response.

        Could the reason it's not woking correctly be because the form is maximized for some reason?? or because it is the startup form?

        Brian

        Comment


          #5
          RE: Application Closing

          Stan,

          I was unable to get this to work. This problem is really strange. The event seems to fire sometimes when I do not want it to ie: trying to get out of design mode via the x on the form upper right corner etc.

          Brian

          Comment


            #6
            RE: Application Closing

            Brian

            There is a very simple way to do what you want if the menu form is always left open in the background. Then closing the menu form can close A5. Just put this on the form CanExit event

            a5.close()

            When the form closes, a5 closes. Your button only has to be set up to close the form. You can also add some checking code if you like to determine if it is ok to close. If you have some reason to prevent closing, just add a cancel(). When the condition is correct to close, skip the cancel()

            Jerry

            Comment


              #7
              RE: Application Closing

              Hello Jerry,

              That's basically how I have it set up at this point. Problem is I want The button to be the only way to close the application. I cannot seem to disable the X in the right upper hand corner. Everything I have tried for the Candatabaseclose event has behaved strangely.

              The reason I am doing this is to make sure the user logs off. The main menu form is maximized.

              Brian

              Comment


                #8
                RE: Application Closing

                You can put

                cancel()

                in the CanExit event for the form. BUT... make certain you have a button on the form that will close it first.

                -- tom

                Comment


                  #9
                  RE: Application Closing

                  Top of the morning to ya Tom,

                  I've tried that alreadly, I went ahead and tried again to be surel. The problem with that I believe is the form is maximized so the X ,again I believe, belongs to the Alpha window itself. So one would think cancel would work on the candatabaseclose event right? Nope? I gotta tell ya, I have blown alot of time trying all kinds of different combinations it's starting to make me feel sick to my stomach. Thanks anyway, got anymore?

                  Brian

                  Comment


                    #10
                    RE: Application Closing

                    Good morning.

                    Not sure what your difficulty is.

                    Here my main menu (startup form) has:

                    1) All Window styles in form properties are unchecked. The form does not display min, max, or system menus.

                    2) Form's CanExit event has "Cancel()"

                    3) Exit Application button on the form has:

                    :A5.close()


                    This form runs maximized. The X in top right corner belongs to Alpha Five and is non-functional. User must push my Exit Application button to close the form.

                    In my design this remains open throughout the app. User must push the button to get back to Windows.

                    Hope this helps.

                    -- tom

                    Comment


                      #11
                      RE: Application Closing

                      Tom,

                      Its still not working, a couple of questions.

                      1) I assume "Form's CanExit event has "Cancel()"" is
                      what is making the X non-functional, Correct?
                      If this is the case it for some reason is not working.

                      2) Where did you set the form to be maximized. When I
                      unchecked all the boxes in window Style in the form
                      properties I lost my form when it loads. I have

                      Comment


                        #12
                        RE: Application Closing

                        Tom,

                        Its still not working, a couple of questions.

                        1) I assume "Form's CanExit event has "Cancel()"" is
                        what is making the X non-functional, Correct?
                        If this is the case it for some reason is not working.

                        2) Where did you set the form to be maximized. When I
                        unchecked all the boxes in window Style in the form
                        properties I lost my form when it loads. I have
                        topparent.maximize() on the oninit event which does not
                        seem to be working because when the form is open I
                        don't see it.

                        When I set out to do this I thought it was only going to take a minute or two this is crazy. Could there be something wrong with my form?

                        Thanks for taking the time to help me out here
                        Brian

                        Comment


                          #13
                          RE: Application Closing

                          In the startup form's OnInit and OnActivate events I do:

                          this.maximize()

                          -- tom

                          Comment


                            #14
                            RE: Application Closing

                            I give up I cannot get the forms size right forms position right or forms event right.

                            So just as a run down on what should work.

                            Database properties
                            1) When database opens open a startup form
                            2) Hide control panel

                            These are the only things I should have checked marked

                            Form properties
                            1)Display - Width - 12.5
                            Height - 8.5

                            2)Position - Left - default
                            Right -default

                            3)Size - Width - use form width
                            Height - use form height

                            4)Window style - Sizeable,System menu,Has caption,minimize
                            button, maximize button - None of these
                            Should be checkmarked

                            5)Frame style - Normal


                            Events
                            1) Oninit - this.maximize()

                            2) Onactivate - this.maximize()

                            3) Canexit - cancel()

                            Ok so the combination of all the above should have my form working 100 percent right??

                            Well none of it is.

                            Thanks for taking the time to try to help.

                            Brian

                            Comment


                              #15
                              RE: Application Closing

                              Why not post a working model of the database here, with instructions for us to follow to see the problem ?

                              Tell us which version of Alpha Five you're using, too, since earlier in this thread you mention not having acquired V6 yet.

                              -- tom

                              Comment

                              Working...
                              X