Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Data
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Imports System.Windows.Forms
Imports Spread.Common.DataStore
Imports Spread.Common.Features.Spread.Common.Features.Sample

Partial Public Class AdvancedSearch
    Inherits BaseSampleControl
    Public Sub New()
        InitializeComponent()
        Name = "Advanced Search Dialog"
        'Set Data
        Dim dataSource As AccessDataSource = New DataService().AccessDataSource
        fpSpread1_Sheet1.DataSource = dataSource.GetNWINDData("Customers")

        fpSpread1_Sheet1.Cells(0, 4).Note = "Current or Permanent Address(Any)"
        fpSpread1_Sheet1.Cells(0, 4).NoteStyle = FarPoint.Win.Spread.NoteStyle.PopupNote
        fpSpread1_Sheet1.Cells(0, 4).NoteIndicatorColor = Color.Blue
        fpSpread1_Sheet1.Cells(0, 4).NoteIndicatorPosition = FarPoint.Win.Spread.NoteIndicatorPosition.TopRight
        fpSpread1_Sheet1.Cells(0, 4).NoteIndicatorSize = New Size(8, 8)
    End Sub

    Private Sub _bSearch_Click(sender As Object, e As EventArgs)
        fpSpread1.SearchWithDialogAdvanced(fpSpread1.ActiveSheetIndex, fpSpread1.ActiveSheetIndex, "", False, False, False,
            False, 0, 0)
    End Sub
End Class

'
'AdvancedSearch.Designer.vb
'

Partial Class AdvancedSearch
	''' <summary> 
	''' Required designer variable.
	''' </summary>
	Private components As System.ComponentModel.IContainer = Nothing

    ''' <summary> 
    ''' Clean up any resources being used.
    ''' </summary>
    ''' <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    Protected Overloads Sub Dispose(disposing As Boolean)
        If disposing AndAlso (components IsNot Nothing) Then
            components.Dispose()
        End If
        MyBase.Dispose(disposing)
    End Sub

#Region "Component Designer generated code"

    ''' <summary> 
    ''' Required method for Designer support - do not modify 
    ''' the contents of this method with the code editor.
    ''' </summary>
    Private Sub InitializeComponent()
		Me.fpSpread1 = New FarPoint.Win.Spread.FpSpread()
		Me.fpSpread1_Sheet1 = New FarPoint.Win.Spread.SheetView()
		Me._bSearch = New System.Windows.Forms.Button()
		Me.pnlMain.SuspendLayout()
		Me.pnlControls.SuspendLayout()
		DirectCast(Me.fpSpread1, System.ComponentModel.ISupportInitialize).BeginInit()
		DirectCast(Me.fpSpread1_Sheet1, System.ComponentModel.ISupportInitialize).BeginInit()
		Me.SuspendLayout()
		' 
		' pnlMain
		' 
		Me.pnlMain.Controls.Add(Me.fpSpread1)
		' 
		' pnlControls
		' 
		Me.pnlControls.Controls.Add(Me._bSearch)
		' 
		' fpSpread1
		' 
		Me.fpSpread1.Dock = System.Windows.Forms.DockStyle.Fill
		Me.fpSpread1.Location = New System.Drawing.Point(0, 0)
		Me.fpSpread1.Name = "fpSpread1"
		Me.fpSpread1.Sheets.AddRange(New FarPoint.Win.Spread.SheetView() {Me.fpSpread1_Sheet1})
		Me.fpSpread1.Size = New System.Drawing.Size(477, 487)
		Me.fpSpread1.TabIndex = 0
		' 
		' fpSpread1_Sheet1
		' 
		Me.fpSpread1_Sheet1.Reset()
		Me.fpSpread1_Sheet1.SheetName = "Sheet1"
		' Formulas and custom names must be loaded with R1C1 reference style
		Me.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1
		Me.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1
		' 
		' _bSearch
		' 
		Me._bSearch.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
		Me._bSearch.Location = New System.Drawing.Point(19, 20)
		Me._bSearch.Name = "_bSearch"
		Me._bSearch.Size = New System.Drawing.Size(120, 23)
		Me._bSearch.TabIndex = 0
		Me._bSearch.Text = "Search"
		Me._bSearch.UseVisualStyleBackColor = True
		AddHandler Me._bSearch.Click, New System.EventHandler(AddressOf Me._bSearch_Click)
		' 
		' AdvancedSearch
		' 
		Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
		Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
		Me.Name = "AdvancedSearch"
		Me.pnlMain.ResumeLayout(False)
		Me.pnlControls.ResumeLayout(False)
		DirectCast(Me.fpSpread1, System.ComponentModel.ISupportInitialize).EndInit()
		DirectCast(Me.fpSpread1_Sheet1, System.ComponentModel.ISupportInitialize).EndInit()
		Me.ResumeLayout(False)

	End Sub

	#End Region

	Private fpSpread1 As FarPoint.Win.Spread.FpSpread
	Private fpSpread1_Sheet1 As FarPoint.Win.Spread.SheetView
	Private _bSearch As System.Windows.Forms.Button
End Class
