
Imports Spread.Common.DataStore
Imports Spread.Common.Features.Spread.Common.Features.Sample

Partial Public Class Introduction
    Inherits BaseSampleControl
    Public Sub New()
        InitializeComponent()
        Name = "Introduction"
        sheetView.Rows.[Default].Height = 25
        sheetView.Columns.[Default].Width = 90

        sheetView.DataSource = New DataService().AccessDataSource.GetNWINDData("Customers")

        sheetView.Cells(2, 3).Note = "This is a cell note that contains additional information about the contents of this cell"
        rowNumericUpDown.Maximum = sheetView.Rows.Count - 1
        columnNumericUpDown.Maximum = sheetView.Columns.Count - 1
        cboNoteStyle.Items.AddRange([Enum].GetNames(GetType(FarPoint.Win.Spread.NoteStyle)))
        cboNoteStyle.SelectedIndex = CInt(FarPoint.Win.Spread.NoteStyle.PopupNote)
    End Sub
    Private Sub addButton_Click(sender As Object, e As EventArgs)
        sheetView.Cells(CInt(Math.Truncate(rowNumericUpDown.Value)), CInt(Math.Truncate(columnNumericUpDown.Value))).Note = commentTextBox.Text
        sheetView.Cells(CInt(Math.Truncate(rowNumericUpDown.Value)), CInt(Math.Truncate(columnNumericUpDown.Value))).NoteStyle = CType(cboNoteStyle.SelectedIndex, FarPoint.Win.Spread.NoteStyle)
    End Sub
End Class

'
'Introduction.Designer.vb
'

Partial Class Introduction
	''' <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.spread = New FarPoint.Win.Spread.FpSpread()
		Me.sheetView = New FarPoint.Win.Spread.SheetView()
		Me.rowLabel = New System.Windows.Forms.Label()
		Me.columnLabel = New System.Windows.Forms.Label()
		Me.rowNumericUpDown = New System.Windows.Forms.NumericUpDown()
		Me.columnNumericUpDown = New System.Windows.Forms.NumericUpDown()
		Me.textLabel = New System.Windows.Forms.Label()
		Me.commentTextBox = New System.Windows.Forms.TextBox()
		Me.cboNoteStyle = New System.Windows.Forms.ComboBox()
		Me.noteStyleLabel = New System.Windows.Forms.Label()
		Me.addButton = New System.Windows.Forms.Button()
		Me.pnlMain.SuspendLayout()
		Me.pnlControls.SuspendLayout()
		DirectCast(Me.spread, System.ComponentModel.ISupportInitialize).BeginInit()
		DirectCast(Me.sheetView, System.ComponentModel.ISupportInitialize).BeginInit()
		DirectCast(Me.rowNumericUpDown, System.ComponentModel.ISupportInitialize).BeginInit()
		DirectCast(Me.columnNumericUpDown, System.ComponentModel.ISupportInitialize).BeginInit()
		Me.SuspendLayout()
		' 
		' pnlMain
		' 
		Me.pnlMain.Controls.Add(Me.spread)
		' 
		' pnlControls
		' 
		Me.pnlControls.Controls.Add(Me.noteStyleLabel)
		Me.pnlControls.Controls.Add(Me.cboNoteStyle)
		Me.pnlControls.Controls.Add(Me.addButton)
		Me.pnlControls.Controls.Add(Me.commentTextBox)
		Me.pnlControls.Controls.Add(Me.textLabel)
		Me.pnlControls.Controls.Add(Me.columnNumericUpDown)
		Me.pnlControls.Controls.Add(Me.rowNumericUpDown)
		Me.pnlControls.Controls.Add(Me.columnLabel)
		Me.pnlControls.Controls.Add(Me.rowLabel)
		' 
		' spread
		' 
		Me.spread.Dock = System.Windows.Forms.DockStyle.Fill
		Me.spread.Location = New System.Drawing.Point(0, 0)
		Me.spread.Name = "spread"
		Me.spread.Sheets.AddRange(New FarPoint.Win.Spread.SheetView() {Me.sheetView})
		Me.spread.Size = New System.Drawing.Size(477, 487)
		Me.spread.TabIndex = 0
		' 
		' sheetView
		' 
		Me.sheetView.Reset()
		Me.sheetView.SheetName = "Introduction"
		' Formulas and custom names must be loaded with R1C1 reference style
		Me.sheetView.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1
		Me.sheetView.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1
		' 
		' rowLabel
		' 
		Me.rowLabel.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
		Me.rowLabel.Location = New System.Drawing.Point(17, 23)
		Me.rowLabel.Name = "rowLabel"
		Me.rowLabel.Size = New System.Drawing.Size(123, 18)
		Me.rowLabel.TabIndex = 0
		Me.rowLabel.Text = "Row Index"
		' 
		' columnLabel
		' 
		Me.columnLabel.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
		Me.columnLabel.Location = New System.Drawing.Point(17, 91)
		Me.columnLabel.Name = "columnLabel"
		Me.columnLabel.Size = New System.Drawing.Size(123, 13)
		Me.columnLabel.TabIndex = 1
		Me.columnLabel.Text = "Column Index"
		' 
		' rowNumericUpDown
		' 
		Me.rowNumericUpDown.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
		Me.rowNumericUpDown.Location = New System.Drawing.Point(20, 44)
		Me.rowNumericUpDown.Name = "rowNumericUpDown"
		Me.rowNumericUpDown.Size = New System.Drawing.Size(120, 20)
		Me.rowNumericUpDown.TabIndex = 2
		' 
		' columnNumericUpDown
		' 
		Me.columnNumericUpDown.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
		Me.columnNumericUpDown.Location = New System.Drawing.Point(20, 107)
		Me.columnNumericUpDown.Name = "columnNumericUpDown"
		Me.columnNumericUpDown.Size = New System.Drawing.Size(120, 20)
		Me.columnNumericUpDown.TabIndex = 3
		' 
		' textLabel
		' 
		Me.textLabel.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
		Me.textLabel.Location = New System.Drawing.Point(17, 145)
		Me.textLabel.Name = "textLabel"
		Me.textLabel.Size = New System.Drawing.Size(123, 13)
		Me.textLabel.TabIndex = 4
		Me.textLabel.Text = "Comment Text"
		' 
		' commentTextBox
		' 
		Me.commentTextBox.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
		Me.commentTextBox.Location = New System.Drawing.Point(20, 161)
		Me.commentTextBox.Multiline = True
		Me.commentTextBox.Name = "commentTextBox"
		Me.commentTextBox.Size = New System.Drawing.Size(120, 50)
		Me.commentTextBox.TabIndex = 5
		' 
		' noteStyleLabel
		' 
		Me.noteStyleLabel.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
		Me.noteStyleLabel.AutoSize = True
		Me.noteStyleLabel.Location = New System.Drawing.Point(17, 234)
		Me.noteStyleLabel.Name = "noteStyleLabel"
		Me.noteStyleLabel.TabIndex = 6
		Me.noteStyleLabel.Text = "Note Style"
		' 
		' cboNoteStyle
		' 
		Me.cboNoteStyle.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
		Me.cboNoteStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
		Me.cboNoteStyle.Location = New System.Drawing.Point(20, 249)
		Me.cboNoteStyle.Name = "cboNoteStyle"
		Me.cboNoteStyle.Size = New System.Drawing.Size(120, 23)
		Me.cboNoteStyle.TabIndex = 7
		' 
		' addButton
		' 
		Me.addButton.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
		Me.addButton.Location = New System.Drawing.Point(20, 279)
		Me.addButton.Name = "addButton"
		Me.addButton.Size = New System.Drawing.Size(120, 23)
		Me.addButton.TabIndex = 8
		Me.addButton.Text = "Add Comment"
		Me.addButton.UseVisualStyleBackColor = True
		AddHandler Me.addButton.Click, New System.EventHandler(AddressOf Me.addButton_Click)
		' 
		' Introduction
		' 
		Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F)
		Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
		Me.Name = "Introduction"
		Me.pnlMain.ResumeLayout(False)
		Me.pnlControls.ResumeLayout(False)
		Me.pnlControls.PerformLayout()
		DirectCast(Me.spread, System.ComponentModel.ISupportInitialize).EndInit()
		DirectCast(Me.sheetView, System.ComponentModel.ISupportInitialize).EndInit()
		DirectCast(Me.rowNumericUpDown, System.ComponentModel.ISupportInitialize).EndInit()
		DirectCast(Me.columnNumericUpDown, System.ComponentModel.ISupportInitialize).EndInit()
		Me.ResumeLayout(False)

	End Sub

	#End Region

	Private spread As FarPoint.Win.Spread.FpSpread
	Private sheetView As FarPoint.Win.Spread.SheetView
	Private commentTextBox As System.Windows.Forms.TextBox
	Private textLabel As System.Windows.Forms.Label
	Private columnNumericUpDown As System.Windows.Forms.NumericUpDown
	Private rowNumericUpDown As System.Windows.Forms.NumericUpDown
	Private columnLabel As System.Windows.Forms.Label
	Private rowLabel As System.Windows.Forms.Label
	Private cboNoteStyle As System.Windows.Forms.ComboBox
	Private noteStyleLabel As System.Windows.Forms.Label
	Private addButton As System.Windows.Forms.Button
End Class
