﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » BrowseDialog Question</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sat, 06 Jun 2026 11:31:53 GMT</lastBuildDate><ttl>20</ttl><item><title>BrowseDialog Question</title><link>http://forum.strataframe.net/FindPost5895.aspx</link><description>I'd like to present users of my application with a warning message if the search criteria entered into a browse dialog returns the maximum number of records (so that they will know that there may be more records than they can see).&amp;nbsp;&amp;nbsp;The TextChanged event of the label in the status bar on the BrowseDialogWindow&amp;nbsp;seems like a good place to do this check as it gets fired when the search ends.&amp;nbsp; I tried sinking this event from&amp;nbsp;a class derived from the BrowseDialogInformationPanel class&amp;nbsp;but the problem is that I can't determine what the maximum number of records allowed is.&amp;nbsp; There doesn't seem to be a way to get back to the BrowseDialog object on the calling form.&amp;nbsp; So, I created a new class derived from the BrowseDialog class.&amp;nbsp; I intended to have it pass the maximum number of allowed records on to the information panel.&amp;nbsp; But I seem to be having trouble inheriting from the BrowseDialog class.&amp;nbsp; As a test, I created a class defined as follows:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Class1&lt;/FONT&gt;&lt;FONT size=2&gt; : MicroFour.StrataFrame.UI.Windows.Forms.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;BrowseDialog&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&lt;/FONT&gt;&lt;FONT size=2&gt; Class1()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;base&lt;/FONT&gt;&lt;FONT size=2&gt;()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&lt;/FONT&gt;&lt;FONT size=2&gt; Class1(System.ComponentModel.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;IContainer&lt;/FONT&gt;&lt;FONT size=2&gt; Container)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;base&lt;/FONT&gt;&lt;FONT size=2&gt;(Container)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;It compiles without a problem and I can paint it onto a form but changes made to the BrowseResultsLayout and SearchFields properties are not persisted.&amp;nbsp; Of course, this makes it useless.&amp;nbsp; Do you guys have any idea what I am doing wrong? Or do you have any better suggestions for accomplishing the original goal?&amp;nbsp; Thanks for your help.&lt;/P&gt;&lt;P&gt;Fran Parker&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 01 Feb 2011 00:09:44 GMT</pubDate><dc:creator>fparker</dc:creator></item><item><title>RE: BrowseDialog Question</title><link>http://forum.strataframe.net/FindPost29476.aspx</link><description>Hi Sam. No problem, here we go:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Add a new Item to your project.&lt;/li&gt;&lt;li&gt;Choose the Component Class.&lt;/li&gt;&lt;li&gt;Name it as you wish, like _BaseBrowseDialog&lt;/li&gt;&lt;li&gt;After added, open the _BaseBrowseDialog.Designer &lt;/li&gt;&lt;li&gt;Right below the "Partial Class" definition line, change the Inherits to&amp;nbsp;&amp;nbsp;"&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;&lt;font color=#0000ff size=2 face=Consolas&gt;Inherits&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2 face=Consolas&gt;&lt;font color=#000000 size=2 face=Consolas&gt; MicroFour.StrataFrame.UI.Windows.Forms.&lt;/font&gt;&lt;/font&gt;&lt;font color=#2b91af size=2 face=Consolas&gt;&lt;font color=#2b91af size=2 face=Consolas&gt;&lt;font color=#2b91af size=2 face=Consolas&gt;BrowseDialog"&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font face=Consolas&gt;&lt;font size=2&gt;&lt;font face=Verdana&gt;Close and save it.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font face=Consolas&gt;&lt;font size=2&gt;&lt;font face=Verdana&gt;Now just double-click the _BaseBrowseDialog from the Solution Explorer to open the designer.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font size=2&gt;Once there, open the Code View window for it and add the following code:&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;[codesnippet]&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;summary&amp;gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' Overrided so to be able to have a Base Browse Dialog&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;/summary&amp;gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Protected Overrides Function IsInheritedBrowseDialog() As Boolean&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Establish locals&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim llReturn As Boolean = False&lt;br/&gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Determine if this is an inherited form&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Me.GetType().IsSubclassOf(GetType(_BaseBrowseDialog)) Then&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- This is an inherited class&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; llReturn = True&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br/&gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Return the value&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return llReturn&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function[/codesnippet]&lt;br/&gt;&lt;br/&gt;&lt;font face=Consolas&gt;&lt;font size=2&gt;&lt;font face=Verdana&gt;Follow this same process for the others, except that you will inherit from other components and you won't need to add the Overrides Function.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face=Consolas&gt;&lt;font size=2&gt;&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;</description><pubDate>Tue, 01 Feb 2011 00:09:44 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: BrowseDialog Question</title><link>http://forum.strataframe.net/FindPost29475.aspx</link><description>Hi Ivan,&lt;br/&gt;&lt;br/&gt;I would really like to begin creating my own base class versions of SF classes as you suggested, but I do not know how to begin that process.&amp;nbsp; Remember I am a beginner.&amp;nbsp; I can see in&amp;nbsp;your LookupControlSample solution that you created your own base class business object and also a base class browse dialog, but I do not know the specific steps required to subclass the SF classes.&lt;br/&gt;&lt;br/&gt;Any help would be appreciated.&lt;br/&gt;&lt;br/&gt;Sam Tenney</description><pubDate>Mon, 31 Jan 2011 20:36:53 GMT</pubDate><dc:creator>Sam Tenney</dc:creator></item><item><title>RE: BrowseDialog Question</title><link>http://forum.strataframe.net/FindPost29467.aspx</link><description>Hi Sam.&lt;br/&gt;&lt;br/&gt;I guess you could start building your Base BrowseDialog so you could create this solution in it and all inherited BD would benefit&amp;nbsp;from it:&lt;br/&gt;&lt;br/&gt;&lt;a href="http://forum.strataframe.net/FindPost27794.aspx"&gt;&lt;a href="http://forum.strataframe.net/FindPost27794.aspx"&gt;&lt;a href="http://forum.strataframe.net/FindPost27794.aspx"&gt;http://forum.strataframe.net/FindPost27794.aspx&lt;/a&gt;&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Then, you could probably use the BrowseDialogClosed event and add some code like this:&lt;br/&gt;&lt;br/&gt;[codesnippet]&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub _BaseBrowseDialog_BrowseDialogClosed(ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogClosedEventArgs) Handles Me.BrowseDialogClosed&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- check if your search exceeded the limit&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If CType(Me.BusinessObjectToPopulate, MicroFour.StrataFrame.Business.BusinessLayer).Count &amp;gt;= Me.MaximumReturnedRecords Then&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- inform the user, try doing it the SF way and use a ShowMessageByKey from a Message &amp;amp; Localization project&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("Your message to the user")&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub[/codesnippet]</description><pubDate>Fri, 28 Jan 2011 15:32:05 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: BrowseDialog Question</title><link>http://forum.strataframe.net/FindPost29466.aspx</link><description>Hi Trent,&lt;br/&gt;&lt;br/&gt;Like this thread from 2007, I also want to present users with a warning message if the search criteria entered into a browse dialog returns the maximum number of records (so that they will know that there may be more records than they can see).&amp;nbsp; I found this thread and looked at your solution but because this thread is over 4 years old and because I do not plan on using a BrowseInformationPanel, I do not know if this is still the best solution because I know a lot of improvements have been made in the browse dialog.&amp;nbsp; I am still a beginner and I would appreciate any suggestions of what to code to use and where to put that code.&lt;br/&gt;&lt;br/&gt;Sam Tenney</description><pubDate>Fri, 28 Jan 2011 14:13:48 GMT</pubDate><dc:creator>Sam Tenney</dc:creator></item><item><title>RE: BrowseDialog Question</title><link>http://forum.strataframe.net/FindPost5907.aspx</link><description>All you have to do since you are using a BrowseInformationPanel is handle the RowChanged event.&amp;nbsp; This contains the reference to the populated business object and you can determine exactly how many records have been returned:&lt;P&gt;[codesnippet]If e.BusinessObject.Count = 1000 Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Place your code here&lt;BR&gt;End If[/codesnippet]&lt;/P&gt;&lt;P&gt;[quote]Do you know why those properties&amp;nbsp;don't work in derived&amp;nbsp;versions of the BrowseDialog class?&amp;nbsp;[/quote]&lt;/P&gt;&lt;P&gt;There is not an issue.&amp;nbsp; You can control this through standard .NET attributes that handle the serialization of the property.&amp;nbsp; You have to overwrite the SearchFields and determine how they will be persisted.&amp;nbsp; This just depends on how the class is subclassed and we did not do this on that sample.&amp;nbsp; This is just basic .NET functionality.&amp;nbsp; The reason this seems wrong is because you have to manage the property differently since it is a collection.&amp;nbsp; It must have the DesignerSerializationVisibility(Content) attribute applied when overwritten.</description><pubDate>Wed, 17 Jan 2007 12:56:58 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: BrowseDialog Question</title><link>http://forum.strataframe.net/FindPost5906.aspx</link><description>What I am really trying to do is make it simple for us to display this warning in all of our applications without having to do any application specific coding.&amp;nbsp; I found that if I created a class derived from the BrowseDialogInformationPanel that I could use this class to sink the TextChanged event of the label in the BrowseDialogWindow's status bar.&amp;nbsp; From there I can determine the number of records returned and, if necessary,&amp;nbsp;display a warning (either in the status bar or as a message box) - all that would be required when developing an application is the use of our derived panel rather than your standard panel.&amp;nbsp; The catch is that there is no way to get access to the MaximumReturnedRecords property of the BrowseDialog class.&amp;nbsp; I could add a MaximumReturnedRecords property to my derived panel but that would require application programmers to set this value in two places (on the panel and on the BrowseDialog object) and I know people would sometimes forget to set them both.&amp;nbsp; &lt;/P&gt;&lt;P&gt;So, what I was thinking was that I could go ahead and add the MaximumReturnedRecords property to my panel and also create a derived version of the BrowseDialog object that would set the MaximumReturnedRecords property of the panel to match its own value.&amp;nbsp; Then application programmers would have to use our version of the BrowseDialog and our panel but would get the warning for free.&lt;/P&gt;&lt;P&gt;I investigated the CRM sample you mentioned and found that the derived BrowseDialog that it contains suffers from the same problem as my test - changes made to the BrowseResultsLayout and SearchFields properties are not persisted.&amp;nbsp; I don't want to force application developers to fill these properties through code as the CRM&amp;nbsp;sample does.&lt;/P&gt;&lt;P&gt;Do you know why those properties&amp;nbsp;don't work in derived&amp;nbsp;versions of the BrowseDialog class?&amp;nbsp; Thanks for your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Fran Parker</description><pubDate>Wed, 17 Jan 2007 12:51:22 GMT</pubDate><dc:creator>fparker</dc:creator></item><item><title>RE: BrowseDialog Question</title><link>http://forum.strataframe.net/FindPost5896.aspx</link><description>Well, you have several issue here.&amp;nbsp; First, you will not be able to inherit the actual form that presents the message.&amp;nbsp; This is not the BrowseDialog class, it is another class that is a dialog called from the&amp;nbsp; BrowseDialog class.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Secondly, you can see an example of how to inherit a BrowseDialog in the Sample CRM Application.&amp;nbsp; It is currently only available on VB.NET but the next update will include this sample in C# as well.&amp;nbsp; But it should at least give you a starting point to see how to subclass a BrowseDialog.&lt;/P&gt;&lt;P&gt;As for presenting a message when the max records are returned, this would require an enhancement to the current browse dialog.&lt;/P&gt;&lt;P&gt;Are you wanting to show the message within a Browse Info Panel?&amp;nbsp;</description><pubDate>Wed, 17 Jan 2007 09:34:32 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>