﻿<?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?)  » Browse dialog subclass</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 08 Apr 2026 03:13:32 GMT</lastBuildDate><ttl>20</ttl><item><title>Browse dialog subclass</title><link>http://forum.strataframe.net/FindPost12036.aspx</link><description>I trying to make a generic browsedialog, I generate the searchfields from a string array, something like:&lt;br&gt;
&lt;br&gt;
[codesnippet]'Private pBrowseDialogSearchFieldTexts() As String = {"ID", "Código", "Descripción"}&lt;br&gt;
        'Private pBrowseDialogSearchFieldFields() As String = {"idProvincia", "CodProvincia", "DesProvincia"}&lt;br&gt;
        Dim iSearchField As Integer = -1&lt;br&gt;
        Dim sfd As SearchFieldItem&lt;br&gt;
        For Each cSearchField As String In pBrowseDialogSearchFieldTexts&lt;br&gt;
            iSearchField += 1&lt;br&gt;
            sfd = New SearchFieldItem&lt;br&gt;
&lt;br&gt;
            sfd.AllowAdvanced = True&lt;br&gt;
            sfd.DefaultSearchStyle = MicroFour.StrataFrame.UI.BrowseDialogAllSearchTypes.BeginsWith&lt;br&gt;
            sfd.EnumType = ""&lt;br&gt;
            sfd.FieldLabelText = pBrowseDialogSearchFieldTexts(iSearchField) '"Customer Name"&lt;br&gt;
            sfd.FieldMask = ""&lt;br&gt;
            sfd.FieldName = pBrowseDialogSearchFieldFields(iSearchField) '"cust_LastName"&lt;br&gt;
            sfd.InitialValue = ""&lt;br&gt;
            sfd.Visible = True&lt;br&gt;
&lt;br&gt;
            'SearchFields.AddRange(New MicroFour.StrataFrame.UI.Windows.Forms.SearchFieldItem() {SearchFieldItem1, SearchFieldItem2, SearchFieldItem3, SearchFieldItem4})&lt;br&gt;
            SearchFields.Add(sfd)&lt;br&gt;
            sfd = Nothing&lt;br&gt;
        Next[/codesnippet]&lt;br&gt;
&lt;br&gt;
When I test the project, it work but when I click on the Browse button from the maintenance toolstrip, an error ocurrs:&lt;br&gt;
&lt;br&gt;
[quote]ullReferenceException&lt;br&gt;
  Referencia a objeto no establecida como instancia de un objeto.&lt;br&gt;
&lt;br&gt;
Source     : MicroFour StrataFrame UI&lt;br&gt;
&lt;br&gt;
Stack Trace: &lt;br&gt;
   en MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog&amp;#119;indow.CreateAllSearchFieldControls()&lt;br&gt;
   en MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog&amp;#119;indow.AddSearchFields()&lt;br&gt;
   en MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog&amp;#119;indow..ctor(BrowseDialog browse, Boolean PopulateOnShow)&lt;br&gt;
   en MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog(Boolean PopulateOnShow, IWin32Window ResultsWindowOwner)&lt;br&gt;
   en MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog(Boolean PopulateOnShow)&lt;br&gt;
   en MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog()&lt;br&gt;
   en MicroFour.StrataFrame.UI.Windows.Forms.MaintenanceFormToolStrip.cmdBrowse_Click(Object sender, EventArgs e)&lt;br&gt;
   en System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)&lt;br&gt;
   en System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)&lt;br&gt;
   en System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)&lt;br&gt;
   en System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)&lt;br&gt;
   en System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)&lt;br&gt;
   en System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)&lt;br&gt;
   en System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)&lt;br&gt;
   en System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)&lt;br&gt;
   en System.Windows.Forms.Control.WndProc(Message&amp; m)&lt;br&gt;
   en System.Windows.Forms.ScrollableControl.WndProc(Message&amp; m)&lt;br&gt;
   en System.Windows.Forms.ToolStrip.WndProc(Message&amp; m)&lt;br&gt;
   en System.Windows.Forms.Control.ControlNative&amp;#119;indow.OnMessage(Message&amp; m)&lt;br&gt;
   en System.Windows.Forms.Control.ControlNative&amp;#119;indow.WndProc(Message&amp; m)&lt;br&gt;
   en System.Windows.Forms.Native&amp;#119;indow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&lt;br&gt;
[/quote]&lt;br&gt;
&lt;br&gt;
I try to add the Strataframe UI project, to debug the "CreateAllSearchFieldControls" method, but some errors ocurrs, I'm using a 1.6.2 test version to develop.&lt;br&gt;
&lt;br&gt;
Can I debug the UI project to see what happen on "CreateAllSearchFieldControls" method or its not posible? if I restore the 1.6.1 dll or something else? thanks!&lt;br&gt;</description><pubDate>Fri, 19 Oct 2007 09:26:24 GMT</pubDate><dc:creator>Fabian R Silva, -</dc:creator></item><item><title>RE: Browse dialog subclass</title><link>http://forum.strataframe.net/FindPost12097.aspx</link><description>Well, this is not a simple answer and will require some more information.&amp;nbsp; There are a number of pieces to creating a BrowseDialog dynamically.&amp;nbsp; It can be done, but from the code that you have posted it will be difficult to give you a straight answer.&lt;/P&gt;&lt;P&gt;As for the 1.6.2 assembly, you will not be able to debug it because you do not have the source code for it.&amp;nbsp; That is the down-side of a pre-release assembly.&amp;nbsp; Sorry :ermm: ...we are still testing the 1.6.2 because we have made some core changes to the UI to improve rendering and performance, so we are still testing at the moment.</description><pubDate>Fri, 19 Oct 2007 09:26:24 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>