Stumped Appleman on this one.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Stumped Appleman on this one.

  1. #1
    Russ Rock Guest

    Stumped Appleman on this one.


    On the surface it seems like a simple question, but I haven't recieved
    a valid answer yet from any of the "experts" - let's see how you do.



    If Form1 shows Form2 (frmForm2.Show, vbModal/vbModeless) either modally
    or modelessly, what API call can I use, while executing code in Form2, to
    determine if the form was called modally or not?




    Some of the answers I recieved were to set a public property on Form2
    or set Form2's tag property with a value or to turn Form2 into a control,
    etc.... All of these answers are well and good and probably work but they
    are too prone to human errors or are too complex and would cause performance
    problems because of the size and scope of this form. Windows should store
    this value somewhere because if you try to access another form modally you
    get a '401' error (I have tried trapping this error but this isn't the cleanest,
    most idiot-proof way of determining the modal/modelessness of the form -
    at least in this application I inherited). How do I access that value??????
    I would think that there should be an API call for it.

    Any help would be greatly appreciated.


    Thanks,

    Russ Rock
    Rock_60110@yahoo.com







    Share on Google+

  2. #2
    deborah Guest

    Re: Stumped Appleman on this one.


    Hi Russ -

    Dan is the API guy. If he didn't know, I would doubt that I would.

    Deborah

    "Russ Rock" <Rock_60110@yahoo.com> wrote:
    >
    > On the surface it seems like a simple question, but I haven't recieved
    >a valid answer yet from any of the "experts" - let's see how you do.
    >
    >
    >
    > If Form1 shows Form2 (frmForm2.Show, vbModal/vbModeless) either modally
    >or modelessly, what API call can I use, while executing code in Form2, to
    >determine if the form was called modally or not?
    >
    >
    >
    >
    > Some of the answers I recieved were to set a public property on Form2
    >or set Form2's tag property with a value or to turn Form2 into a control,
    >etc.... All of these answers are well and good and probably work but they
    >are too prone to human errors or are too complex and would cause performance
    >problems because of the size and scope of this form. Windows should store
    >this value somewhere because if you try to access another form modally you
    >get a '401' error (I have tried trapping this error but this isn't the cleanest,
    >most idiot-proof way of determining the modal/modelessness of the form -
    > at least in this application I inherited). How do I access that value??????
    > I would think that there should be an API call for it.
    >
    >Any help would be greatly appreciated.
    >
    >
    >Thanks,
    >
    >Russ Rock
    >Rock_60110@yahoo.com
    >
    >
    >
    >
    >
    >
    >


    Share on Google+

  3. #3
    D. Patrick Hoerter Guest

    Re: Stumped Appleman on this one.

    Russ,

    Why not just add a public Property Let/Get pair in there on Form2, such
    as vbFormMode, and check it that way. Simplify your life.

    i.e.

    Load Form2
    Form2.vbFormMode = vbModal
    Form2.Show vbModal

    Regards,
    D. Patrick Hoerter

    Russ Rock wrote in message <38fb4761$1@news.devx.com>...
    >
    > On the surface it seems like a simple question, but I haven't recieved
    >a valid answer yet from any of the "experts" - let's see how you do.
    >
    >
    >
    > If Form1 shows Form2 (frmForm2.Show, vbModal/vbModeless) either modally
    >or modelessly, what API call can I use, while executing code in Form2, to
    >determine if the form was called modally or not?
    >
    >
    >
    >
    > Some of the answers I recieved were to set a public property on Form2
    >or set Form2's tag property with a value or to turn Form2 into a control,
    >etc.... All of these answers are well and good and probably work but they
    >are too prone to human errors or are too complex and would cause

    performance
    >problems because of the size and scope of this form. Windows should store
    >this value somewhere because if you try to access another form modally you
    >get a '401' error (I have tried trapping this error but this isn't the

    cleanest,
    >most idiot-proof way of determining the modal/modelessness of the form -
    > at least in this application I inherited). How do I access that

    value??????
    > I would think that there should be an API call for it.
    >
    >Any help would be greatly appreciated.
    >
    >
    >Thanks,
    >
    >Russ Rock
    >Rock_60110@yahoo.com
    >
    >
    >
    >
    >
    >
    >


    Share on Google+

  4. #4
    Tore Bostrup Guest

    Re: Stumped Appleman on this one.


    Check Microsoft article "How to Determine Display State of a VB Form, Modal
    or Modeless" (ID: Q77316).

    However, since you have to check the style of all the OTHER forms in your
    app, it may be easier to use the alternative approach suggested, or use your
    error-trap in a determination routine.

    HTH,
    Tore.


    "Russ Rock" <Rock_60110@yahoo.com> wrote:
    >
    > On the surface it seems like a simple question, but I haven't recieved
    >a valid answer yet from any of the "experts" - let's see how you do.
    >
    >
    >
    > If Form1 shows Form2 (frmForm2.Show, vbModal/vbModeless) either modally
    >or modelessly, what API call can I use, while executing code in Form2, to
    >determine if the form was called modally or not?
    >
    >
    >
    >
    > Some of the answers I recieved were to set a public property on Form2
    >or set Form2's tag property with a value or to turn Form2 into a control,
    >etc.... All of these answers are well and good and probably work but they
    >are too prone to human errors or are too complex and would cause performance
    >problems because of the size and scope of this form. Windows should store
    >this value somewhere because if you try to access another form modally you
    >get a '401' error (I have tried trapping this error but this isn't the cleanest,
    >most idiot-proof way of determining the modal/modelessness of the form -
    > at least in this application I inherited). How do I access that value??????
    > I would think that there should be an API call for it.
    >
    >Any help would be greatly appreciated.
    >
    >
    >Thanks,
    >
    >Russ Rock
    >Rock_60110@yahoo.com
    >
    >
    >
    >
    >
    >
    >


    Share on Google+

  5. #5
    Russ Rock Guest

    Re: Stumped Appleman on this one.


    Since this form is called from 50+ other forms ("Form2" is a generic all-purpose
    searching form), I want to try to avoid editing those 50+ forms if I can
    just put code in the destination form.

    Also, by adding this code in "Form2" form, future developers who link to
    this form won't have to keep track of every other customizable work-around
    - they can just show the form and have the called form know how to implement
    the special logic. (It makes this form more "idiot-proof".)






    "D. Patrick Hoerter" <dphwebAT@bellatlanticDOT.net> wrote:
    >Russ,
    >
    > Why not just add a public Property Let/Get pair in there on Form2, such
    >as vbFormMode, and check it that way. Simplify your life.
    >
    > i.e.
    >
    > Load Form2
    > Form2.vbFormMode = vbModal
    > Form2.Show vbModal
    >
    >Regards,
    >D. Patrick Hoerter
    >
    >Russ Rock wrote in message <38fb4761$1@news.devx.com>...
    >>
    >> On the surface it seems like a simple question, but I haven't recieved
    >>a valid answer yet from any of the "experts" - let's see how you do.
    >>
    >>
    >>
    >> If Form1 shows Form2 (frmForm2.Show, vbModal/vbModeless) either modally
    >>or modelessly, what API call can I use, while executing code in Form2,

    to
    >>determine if the form was called modally or not?
    >>
    >>
    >>
    >>
    >> Some of the answers I recieved were to set a public property on Form2
    >>or set Form2's tag property with a value or to turn Form2 into a control,
    >>etc.... All of these answers are well and good and probably work but

    they
    >>are too prone to human errors or are too complex and would cause

    >performance
    >>problems because of the size and scope of this form. Windows should store
    >>this value somewhere because if you try to access another form modally

    you
    >>get a '401' error (I have tried trapping this error but this isn't the

    >cleanest,
    >>most idiot-proof way of determining the modal/modelessness of the form

    -
    >> at least in this application I inherited). How do I access that

    >value??????
    >> I would think that there should be an API call for it.
    >>
    >>Any help would be greatly appreciated.
    >>
    >>
    >>Thanks,
    >>
    >>Russ Rock
    >>Rock_60110@yahoo.com
    >>
    >>
    >>
    >>
    >>
    >>
    >>

    >


    Share on Google+

  6. #6
    Larry Johnson Guest

    Re: Stumped Appleman on this one.


    Russ, check out this MS article...
    http://support.microsoft.com/support...s/Q77/3/16.ASP


    "Russ Rock" <Rock_60110@yahoo.com> wrote:
    >
    >Since this form is called from 50+ other forms ("Form2" is a generic all-purpose
    >searching form), I want to try to avoid editing those 50+ forms if I can
    >just put code in the destination form.
    >
    >Also, by adding this code in "Form2" form, future developers who link to
    >this form won't have to keep track of every other customizable work-around
    >- they can just show the form and have the called form know how to implement
    >the special logic. (It makes this form more "idiot-proof".)
    >
    >
    >
    >
    >
    >
    >"D. Patrick Hoerter" <dphwebAT@bellatlanticDOT.net> wrote:
    >>Russ,
    >>
    >> Why not just add a public Property Let/Get pair in there on Form2,

    such
    >>as vbFormMode, and check it that way. Simplify your life.
    >>
    >> i.e.
    >>
    >> Load Form2
    >> Form2.vbFormMode = vbModal
    >> Form2.Show vbModal
    >>
    >>Regards,
    >>D. Patrick Hoerter
    >>
    >>Russ Rock wrote in message <38fb4761$1@news.devx.com>...
    >>>
    >>> On the surface it seems like a simple question, but I haven't recieved
    >>>a valid answer yet from any of the "experts" - let's see how you do.
    >>>
    >>>
    >>>
    >>> If Form1 shows Form2 (frmForm2.Show, vbModal/vbModeless) either modally
    >>>or modelessly, what API call can I use, while executing code in Form2,

    >to
    >>>determine if the form was called modally or not?
    >>>
    >>>
    >>>
    >>>
    >>> Some of the answers I recieved were to set a public property on Form2
    >>>or set Form2's tag property with a value or to turn Form2 into a control,
    >>>etc.... All of these answers are well and good and probably work but

    >they
    >>>are too prone to human errors or are too complex and would cause

    >>performance
    >>>problems because of the size and scope of this form. Windows should store
    >>>this value somewhere because if you try to access another form modally

    >you
    >>>get a '401' error (I have tried trapping this error but this isn't the

    >>cleanest,
    >>>most idiot-proof way of determining the modal/modelessness of the form

    >-
    >>> at least in this application I inherited). How do I access that

    >>value??????
    >>> I would think that there should be an API call for it.
    >>>
    >>>Any help would be greatly appreciated.
    >>>
    >>>
    >>>Thanks,
    >>>
    >>>Russ Rock
    >>>Rock_60110@yahoo.com
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>

    >>

    >


    Share on Google+

Similar Threads

  1. Appleman Re: VB.Net
    By Zane Thomas in forum .NET
    Replies: 10
    Last Post: 09-28-2001, 07:46 AM
  2. Appleman Re: VB.Net
    By Jay Glynn in forum .NET
    Replies: 1
    Last Post: 09-26-2001, 05:38 PM
  3. HELP - ADO problem has me stumped.
    By J. Giudice in forum ASP.NET
    Replies: 0
    Last Post: 10-12-2000, 10:16 PM
  4. This problem really stumped me
    By Kofi Brown in forum VB Classic
    Replies: 0
    Last Post: 05-08-2000, 03:40 PM
  5. Get Expert Answers from Dan Appleman on DevX
    By Rachel Palmer in forum vb.announcements
    Replies: 0
    Last Post: 04-05-2000, 02:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center