A message has been sent to the nsb-ce group and is awaiting approval. We've 
attached this message for your review.

This message requires approval because the message may be spam.

You can approve or reject this message online at:
http://groups.google.com/group/nsb-ce/pendmsg?hl=en

or

You can approve this message by replying to this email.

Thank you,

The Google Groups Team

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nsb-ce" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en
-~----------~----~----~----~------~----~------~--~---

--- Begin Message ---
 A message has been sent to the nsb-ce group and is awaiting approval. We've 
attached this message for your review.

This message requires approval because the message may be spam.

You can approve or reject this message online at:
http://groups.google.com/group/nsb-ce/pendmsg?hl=en

or

You can approve this message by replying to this email.

Thank you,

The Google Groups Team
--- Begin Message ---
 A message has been sent to the nsb-ce group and is awaiting approval. We've 
attached this message for your review.

This message requires approval because the message may be spam.

You can approve or reject this message online at:
http://groups.google.com/group/nsb-ce/pendmsg?hl=en

or

You can approve this message by replying to this email.

Thank you,

The Google Groups Team
--- Begin Message ---
I guess I have been writing at the wrong end of the reply box!! Can I
get anything right?

My main form contains a grid full of columns of data from an open
database.
Clicking a particular cell in the grid produces a dialog with the
title bar showing the Title from a database field and has buttons on
the dialog for various options.

The solution to the problem is not clever, simply the position of the
code that handles the button events. It must be done inside the sub
that called the dialog, not a separate sub in the main program.
(This wasn't obvious to me and I could not find a single example in
the examples folder) The Login example did not contain any buttons and
the '_' is a red herring, in that it only permits the same (not quite)
name to be used, it does not perform any special function.

Much experimenting 'dropped the penny'. Perhaps somebody has the time
to write a small sample to illustrate this, it might save others a lot
of time. 
Maybe everybody elses is brighter than me and would have known anyway!
So if this is obvious then delete this reply.
NOTE that one difference between dialogX dialogs and API dialogs is
the fact that the latter will not move above the title bar, the former
will (as far as I could find).

My main program contains the following...
'-----------------------------------------------------------
...
MakeDialogs
...
'-----------------------------------------------------------
Sub Grid_Click
...
...
      If rs.Fields("Info")<>"" Then
         dInfo.Title=rs.Fields("Title")
         dInfo.SetCaption "txtInfo", rs.Fields("Info")

'This handles the button/buttons on the dialog
'A Case statement could probably be used here to avoid the Ifs
'It will not work outside this calling sub

         If dInfo.DoModal=3 Then
                MsgBox("3") '(or 2 or 4)
         End If
      End If            
...
...
end sub

'------------------------------------------------------------
Sub MakeDialogs
        AddObject "DialogX", "dInfo",0
        dInfo.Width=165 : dInfo.Height=54
        dInfo.CaptionClose=False
        dInfo.AddObject "TextBox", "txtInfo", 1, 2, 163, 37
        dInfo.SetMultiLine "txtInfo", True
        dInfo.SetMaxLength "txtInfo", 255
        dInfo.AddObject "CommandButton", "bEdit", 2, 40, 27, 12
        dInfo.SetCaption "bEdit", "Update"
        dInfo.SetReturnValue "bEdit", 2
        dInfo.AddObject "CommandButton", "bMark", 24, 40, 31, 12
        dInfo.SetCaption "bMark", "To See"
        dInfo.SetReturnValue "bMark", 3
        dInfo.AddObject "CommandButton", "bSeen", 53, 40, 20, 12
        dInfo.SetCaption "bSeen", "Seen"
        dInfo.SetReturnValue "bSeen", 4
End Sub

End of reply


--- In [email protected], "George Henne" <g...@...> wrote:
>
> Great!
> 
> Can you post what you did, in case someone else sees this thread?
> 
> 
> 
> >--- In [email protected], "enonod" <enonod@> wrote:
> >>
> >> --- In [email protected], "enonod" <enonod@> wrote:
> >> >
> >> > --- In [email protected], "George Henne" <gh@> wrote:
> >> > >
> >> > > Have a look at the Login sample. It capture events from DialogX
> >> > > controls: notice it does something interesting with the "_"
> >character.
> >> > > 
> >> > > George Henne                                     
> >> > > NS BASIC Corporation
> >> > > http://www.nsbasic.com 
> >> > > 
> >> > > >I have been away a while and obviously suffer from a memory
> >problem.
> >> > > >I have a button declared on a DialogX form and the click event
> >> doesn't
> >> > > >work.
> >> > > >I put the button on the main form with the same name and it
works.
> >> > > >
> >> > > >This says to me that there is a problem with my naming.
> >> > > >
> >> > > >The button was declared in a DialogX sub...
> >> > > >
> >> > > >  dTitle.AddObject "CommandButton", "bInfo", 210, 75, 45, 12
> >> > > >  dTitle.SetCaption "bInfo", "Info"
> >> > > >
> >> > > >sub bInfo_click
> >> > > >  MsgBox("OK")
> >> > > >end sub
> >> > > >
> >> > > >I tried sub dTitle.bInfo_Click but a message said "...expected
> >'(' "
> >> > > >
> >> > > >I am sure I have had this sort of thing working previously, any
> >> memory
> >> > > >jogger would be of great assistance. Thanks
> >> > > >
> >> > > >
> >> > > >------------------------------------
> >> > > >
> >> > > >Yahoo! Groups Links
> >> > > >
> >> > > >
> >> > > >
> >> > >
> >> > Thank you for the response George. This does not 'seem' to solve my
> >> > problem. As I see it the underscore on the end of the dialog
name only
> >> > appears to permit the same name to be used for the variable holding
> >> > the dialog. If there is more to it I would like to know please.
> >> > 
> >> > That aside, The Login sample doesn't have any dialog buttons. My
> >> > dialogs work in that the textboxes etc. pass text back and
forth. What
> >> > doesn't work is CommandButton events.
> >> > If I put a button with the same name on the main form, then the
event
> >> > sub gets called, but when it is on the dialog (not a second form in
> >> > the normal sense) it is not called. This says to me that the
naming of
> >> > the sub is wrong.
> >> > 
> >> > To add to my earlier example I now tried what I think you were
> >> > pointing me at and used dTitle_ for the DialogX name then...
> >> > Set dTitle_ = dTitle
> >> > 
> >> > Then
> >> > sub dTitle.bInfo_Click
> >> > etc.
> >> > I got the error 'Name Redefined'
> >> > 
> >> > I would appreciate further help please.
> >> > Thanks
> >> >
> >> 
> >> Perhaps I can put this in simpler terms and get some help...
> >> A button does not seem to respond to a click when on a DialogX
dialog.
> >> The example quoted "Login" does not use a button on its dialog
only on
> >> the main form, so the relevance escapes me.
> >>
> >I have managed to solve this, so no reply needed.
> >
> >
> >------------------------------------
> >
> >Yahoo! Groups Links
> >
> >
> >
>



--- End Message ---

--- End Message ---

--- End Message ---

Reply via email to