Browse Dialog Results


Author
Message
Paul Chase
Paul Chase
Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K

I have been meaning to ask for this for awhile but never get around to it and just end up doing it my local SF source then forgetting about it until the next time I update Smile. My users are migrating from a FPW app and really love the keyboard, so in trying to keep the native's happy I have my browse dialogs set up as follows I have the search key set to keys.enter and the setfocustoresultsaftersearch property to true and have added code below to the BD source to handle the lv.results key down

The idea is that a user can enter their search criteria hit enter, the results come up, and then they arrow down to the correct record, hit enter and the BD copy's data and closes form. Setting both the search and accept key to enter will not work as the search would evaluate first so it would just keep searching, so what I have been doing is trapping the Lvresults key down event and if enter copy data and close form as below. 

I'm sure you guys would want to add a property to turn this on/off and what not but if you could add this I'd sure be happy about it.

Thanks Paul

Private Sub lvResults_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles lvResults.KeyDown

If e.KeyCode = Keys.Enter Then

 

If lvResults.SelectedItems().Count > 0 Then

Me.CopyDataAndCloseForm()

End If

End If

End Sub

   


Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
In case I am missing something, you should be able to do this right now....or at least get really close.  There is a propertly called SetFocusToResultsAfterSearch which will move the focus to the results set after a query...you can then use the keyboard to find the desired record.  Also, you can control the search and accept keys using the following properties:

  • AcceptKey
  • CancelKey
  • SearchKey

Paul Chase
Paul Chase
Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Trent,

One of is misssing something Smile I currently have my BD set up with the search key being enter set results to focus = true and accept key to enter. with that set up the user would

  1. enter search criteria hit enter --Search key is set to Enter
  2. Focus is set to results and user arrows through them
  3. user finds correct record and hits enter--- the form executes another search rather than accepting and closing

looak at code below and you will see what i mean,

''' <summary>

''' Pre-filters all key strokes to see if any special action needs to take place

''' </summary>

Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As Boolean

If keyData = _BrowseDialog.SearchKey Then

Me.ExecuteSearch()

ElseIf keyData = _BrowseDialog.AcceptKey Then

If Me.cmdOK.Enabled Then

CopyDataAndCloseForm()

End If

ElseIf keyData = _BrowseDialog.CancelKey Then

DialogResult = System.Windows.Forms.DialogResult.Cancel

Else

Return MyBase.ProcessCmdKey(msg, keyData)

End If

'-- Just return a value indicating the item was handled

Return True

End Function


Ivan George Borges
Ivan George Borges
Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
I currently have my BD set up with the search key being enter

and accept key to enter.

Hey Paul.

Have you tried setting different keys to each of this actions?

Paul Chase
Paul Chase
Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Hiya Ivan,

That would work but not how my user's want it to work.BigGrin I have tried to do it with all types of combination's with the browse dialog but it is not really doable.

My users want to use the enter key for both the search and accept. So asigning the say F2 key to the accept button is not what they want they want to be able to do, they wish to do the following

  1. browse dialog displays
  2. user enter's search criteria using Tab key to go between multiple search fields
  3. user hits the enter key which then executes the search and then the focus is set to the results list view.
  4. user arrows down to correct record and then uses the Enter Key again to accept and select that record.

In other word's the Results List View would just respond to the enter key the same way it does to a double click.

 In my foxpro system the users enter their search criteria hit enter and then another modal picklist form pops up and they arrow through the results and then hit enter wich closes both the modal results form and the underlying search form and leaves them on the record they were looking for in the particular edit screen. So I am trying to emulate that  process of type first name "john" hit tab key type last name "do" hit enter set n results arrow to john doe's record hit enter form closes and I am on john does employee maintence form.

Hope that makes sence

Edhy Rijo
E
StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Paul,

And it all make sense to me, it looks like a very logic and direct approach to navigate in the Dialog Browser.

Edhy Rijo

Paul Chase
Paul Chase
Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)Advanced StrataFrame User (510 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Thanks Edhy sometimes I only make sense to myself!!BigGrin
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search