Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Visual Basic [игнор отключен] [закрыт для гостей] / Как в VB из одной формы обратиться к элементам другой формы? / 10 сообщений из 10, страница 1 из 1
09.08.2004, 09:37
    #32640282
V-Imir
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как в VB из одной формы обратиться к элементам другой формы?
Помогите! Я понимаю что вопрос достаточно глупый, но VB начал изучать совсем недавно. Как в VB из одной формы обратиться к элементам другой формы? Например: имеется две формы Form1 и Form2, как из Form2 изменить надпись на кнопке в Form1?
...
Рейтинг: 0 / 0
09.08.2004, 09:55
    #32640309
raur
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как в VB из одной формы обратиться к элементам другой формы?
private sub Form2_load
Form1.Command1.Caption = "kjgkgh"
end sub
...
Рейтинг: 0 / 0
09.08.2004, 10:23
    #32640368
V-Imir
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как в VB из одной формы обратиться к элементам другой формы?
Я тоже себе так представлял, основываясь на опыте работы c Дельфи, но вот что мне пишет компилятор: Reference to a non-shared member requires an object reference. Может нужно Form1 задекларировать в Form2? Если да, то где и как?
...
Рейтинг: 0 / 0
09.08.2004, 10:27
    #32640378
raur
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как в VB из одной формы обратиться к элементам другой формы?
ничего не нужно...
выложи код, посмотрим...
...
Рейтинг: 0 / 0
09.08.2004, 10:53
    #32640432
V-Imir
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как в VB из одной формы обратиться к элементам другой формы?
Конечно, может я сюда чего лишнего впаял, просто побоялся чего-то упустить... Вот это главная форма, на ней есть MainFormStatusBar к которому мне надо обратиться из второй формы...

Public Class MainForm
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer. InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor. Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem5 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem6 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem7 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem8 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem9 As System.Windows.Forms.MenuItem
Friend WithEvents MainFormNotifyIcon As System.Windows.Forms.NotifyIcon
Friend WithEvents MainFormContextMenu As System.Windows.Forms.ContextMenu
Friend WithEvents MenuItem10 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem11 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem12 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem13 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem14 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem15 As System.Windows.Forms.MenuItem
Friend WithEvents Panel1 As System.Windows.Forms.StatusBarPanel
Friend WithEvents Panel2 As System.Windows.Forms.StatusBarPanel
Friend WithEvents Panel3 As System.Windows.Forms.StatusBarPanel
Friend WithEvents MainFormStatusBar As System.Windows.Forms.StatusBar
Friend WithEvents OdbcDataAdapter1 As System.Data.Odbc.OdbcDataAdapter
Friend WithEvents OdbcSelectCommand1 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcInsertCommand1 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcUpdateCommand1 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcDeleteCommand1 As System.Data.Odbc.OdbcCommand
Friend WithEvents OdbcConnection1 As System.Data.Odbc.OdbcConnection
Friend WithEvents OrderDSet1 As Unimars.OrderDSet
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(MainForm))
Me.MainFormStatusBar = New System.Windows.Forms.StatusBar
Me.Panel1 = New System.Windows.Forms.StatusBarPanel
Me.Panel2 = New System.Windows.Forms.StatusBarPanel
Me.Panel3 = New System.Windows.Forms.StatusBarPanel
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.MenuItem1 = New System.Windows.Forms.MenuItem
Me.MenuItem2 = New System.Windows.Forms.MenuItem
Me.MenuItem3 = New System.Windows.Forms.MenuItem
Me.MenuItem4 = New System.Windows.Forms.MenuItem
Me.MenuItem5 = New System.Windows.Forms.MenuItem
Me.MenuItem6 = New System.Windows.Forms.MenuItem
Me.MenuItem7 = New System.Windows.Forms.MenuItem
Me.MenuItem13 = New System.Windows.Forms.MenuItem
Me.MenuItem15 = New System.Windows.Forms.MenuItem
Me.MenuItem14 = New System.Windows.Forms.MenuItem
Me.MenuItem8 = New System.Windows.Forms.MenuItem
Me.MenuItem9 = New System.Windows.Forms.MenuItem
Me.MainFormNotifyIcon = New System.Windows.Forms.NotifyIcon(Me.components)
Me.MainFormContextMenu = New System.Windows.Forms.ContextMenu
Me.MenuItem10 = New System.Windows.Forms.MenuItem
Me.MenuItem11 = New System.Windows.Forms.MenuItem
Me.MenuItem12 = New System.Windows.Forms.MenuItem
Me.OdbcDataAdapter1 = New System.Data.Odbc.OdbcDataAdapter
Me.OdbcDeleteCommand1 = New System.Data.Odbc.OdbcCommand
Me.OdbcConnection1 = New System.Data.Odbc.OdbcConnection
Me.OdbcInsertCommand1 = New System.Data.Odbc.OdbcCommand
Me.OdbcSelectCommand1 = New System.Data.Odbc.OdbcCommand
Me.OdbcUpdateCommand1 = New System.Data.Odbc.OdbcCommand
Me.OrderDSet1 = New Unimars.OrderDSet
CType(Me.Panel1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.Panel2, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.Panel3, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.OrderDSet1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'MainFormStatusBar '
Me.MainFormStatusBar.AccessibleDescription = resources.GetString("MainFormStatusBar.AccessibleDescription")
Me.MainFormStatusBar.AccessibleName = resources.GetString("MainFormStatusBar.AccessibleName")
Me.MainFormStatusBar.Anchor = CType(resources.GetObject("MainFormStatusBar.Anchor"), System.Windows.Forms.AnchorStyles)
Me.MainFormStatusBar.BackgroundImage = CType(resources.GetObject("MainFormStatusBar.BackgroundImage"), System.Drawing.Image)
Me.MainFormStatusBar.Dock = CType(resources.GetObject("MainFormStatusBar.Dock"), System.Windows.Forms.DockStyle)
Me.MainFormStatusBar.Enabled = CType(resources.GetObject("MainFormStatusBar.Enabled"), Boolean)
Me.MainFormStatusBar.Font = CType(resources.GetObject("MainFormStatusBar.Font"), System.Drawing.Font)
Me.MainFormStatusBar.ImeMode = CType(resources.GetObject("MainFormStatusBar.ImeMode"), System.Windows.Forms.ImeMode)
Me.MainFormStatusBar.Location = CType(resources.GetObject("MainFormStatusBar.Location"), System.Drawing.Point)
Me.MainFormStatusBar.Name = "MainFormStatusBar"
Me.MainFormStatusBar.Panels.AddRange(New System.Windows.Forms.StatusBarPanel() {Me.Panel1, Me.Panel2, Me.Panel3})
Me.MainFormStatusBar.RightToLeft = CType(resources.GetObject("MainFormStatusBar.RightToLeft"), System.Windows.Forms.RightToLeft)
Me.MainFormStatusBar.ShowPanels = True
Me.MainFormStatusBar.Size = CType(resources.GetObject("MainFormStatusBar.Size"), System.Drawing.Size)
Me.MainFormStatusBar.TabIndex = CType(resources.GetObject("MainFormStatusBar.TabIndex"), Integer)
Me.MainFormStatusBar.Text = resources.GetString("MainFormStatusBar.Text")
Me.MainFormStatusBar.Visible = CType(resources.GetObject("MainFormStatusBar.Visible"), Boolean)
'
'Panel1
'
Me.Panel1.Alignment = CType(resources.GetObject("Panel1.Alignment"), System.Windows.Forms.HorizontalAlignment)
Me.Panel1.Icon = CType(resources.GetObject("Panel1.Icon"), System.Drawing.Icon)
Me.Panel1.MinWidth = CType(resources.GetObject("Panel1.MinWidth"), Integer)
Me.Panel1.Text = resources.GetString("Panel1.Text")
Me.Panel1.ToolTipText = resources.GetString("Panel1.ToolTipText")
Me.Panel1.Width = CType(resources.GetObject("Panel1.Width"), Integer)
'
'Panel2
'
Me.Panel2.Alignment = CType(resources.GetObject("Panel2.Alignment"), System.Windows.Forms.HorizontalAlignment)
Me.Panel2.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring
Me.Panel2.Icon = CType(resources.GetObject("Panel2.Icon"), System.Drawing.Icon)
Me.Panel2.MinWidth = CType(resources.GetObject("Panel2.MinWidth"), Integer)
Me.Panel2.Text = resources.GetString("Panel2.Text")
Me.Panel2.ToolTipText = resources.GetString("Panel2.ToolTipText")
Me.Panel2.Width = CType(resources.GetObject("Panel2.Width"), Integer)
'
'Panel3
'
Me.Panel3.Alignment = CType(resources.GetObject("Panel3.Alignment"), System.Windows.Forms.HorizontalAlignment)
Me.Panel3.Icon = CType(resources.GetObject("Panel3.Icon"), System.Drawing.Icon)
Me.Panel3.MinWidth = CType(resources.GetObject("Panel3.MinWidth"), Integer)
Me.Panel3.Text = resources.GetString("Panel3.Text")
Me.Panel3.ToolTipText = resources.GetString("Panel3.ToolTipText")
Me.Panel3.Width = CType(resources.GetObject("Panel3.Width"), Integer)
'
'MainMenu1
'
Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem5, Me.MenuItem6, Me.MenuItem7, Me.MenuItem8})
Me.MainMenu1.RightToLeft = CType(resources.GetObject("MainMenu1.RightToLeft"), System.Windows.Forms.RightToLeft)
'
'MenuItem1
'
Me.MenuItem1.Enabled = CType(resources.GetObject("MenuItem1.Enabled"), Boolean)
Me.MenuItem1.Index = 0
Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem2, Me.MenuItem3, Me.MenuItem4})
Me.MenuItem1.Shortcut = CType(resources.GetObject("MenuItem1.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem1.ShowShortcut = CType(resources.GetObject("MenuItem1.ShowShortcut"), Boolean)
Me.MenuItem1.Text = resources.GetString("MenuItem1.Text")
Me.MenuItem1.Visible = CType(resources.GetObject("MenuItem1.Visible"), Boolean)
'
'MenuItem2
'
Me.MenuItem2.Enabled = CType(resources.GetObject("MenuItem2.Enabled"), Boolean)
Me.MenuItem2.Index = 0
Me.MenuItem2.Shortcut = CType(resources.GetObject("MenuItem2.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem2.ShowShortcut = CType(resources.GetObject("MenuItem2.ShowShortcut"), Boolean)
Me.MenuItem2.Text = resources.GetString("MenuItem2.Text")
Me.MenuItem2.Visible = CType(resources.GetObject("MenuItem2.Visible"), Boolean)
'
'MenuItem3
'
Me.MenuItem3.Enabled = CType(resources.GetObject("MenuItem3.Enabled"), Boolean)
Me.MenuItem3.Index = 1
Me.MenuItem3.Shortcut = CType(resources.GetObject("MenuItem3.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem3.ShowShortcut = CType(resources.GetObject("MenuItem3.ShowShortcut"), Boolean)
Me.MenuItem3.Text = resources.GetString("MenuItem3.Text")
Me.MenuItem3.Visible = CType(resources.GetObject("MenuItem3.Visible"), Boolean)
'
'MenuItem4
'
Me.MenuItem4.Enabled = CType(resources.GetObject("MenuItem4.Enabled"), Boolean)
Me.MenuItem4.Index = 2
Me.MenuItem4.Shortcut = CType(resources.GetObject("MenuItem4.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem4.ShowShortcut = CType(resources.GetObject("MenuItem4.ShowShortcut"), Boolean)
Me.MenuItem4.Text = resources.GetString("MenuItem4.Text")
Me.MenuItem4.Visible = CType(resources.GetObject("MenuItem4.Visible"), Boolean)
'
'MenuItem5
'
Me.MenuItem5.Enabled = CType(resources.GetObject("MenuItem5.Enabled"), Boolean)
Me.MenuItem5.Index = 1
Me.MenuItem5.Shortcut = CType(resources.GetObject("MenuItem5.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem5.ShowShortcut = CType(resources.GetObject("MenuItem5.ShowShortcut"), Boolean)
Me.MenuItem5.Text = resources.GetString("MenuItem5.Text")
Me.MenuItem5.Visible = CType(resources.GetObject("MenuItem5.Visible"), Boolean)
'
'MenuItem6
'
Me.MenuItem6.Enabled = CType(resources.GetObject("MenuItem6.Enabled"), Boolean)
Me.MenuItem6.Index = 2
Me.MenuItem6.Shortcut = CType(resources.GetObject("MenuItem6.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem6.ShowShortcut = CType(resources.GetObject("MenuItem6.ShowShortcut"), Boolean)
Me.MenuItem6.Text = resources.GetString("MenuItem6.Text")
Me.MenuItem6.Visible = CType(resources.GetObject("MenuItem6.Visible"), Boolean)
'
'MenuItem7
'
Me.MenuItem7.Enabled = CType(resources.GetObject("MenuItem7.Enabled"), Boolean)
Me.MenuItem7.Index = 3
Me.MenuItem7.MdiList = True
Me.MenuItem7.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem13, Me.MenuItem15, Me.MenuItem14})
Me.MenuItem7.Shortcut = CType(resources.GetObject("MenuItem7.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem7.ShowShortcut = CType(resources.GetObject("MenuItem7.ShowShortcut"), Boolean)
Me.MenuItem7.Text = resources.GetString("MenuItem7.Text")
Me.MenuItem7.Visible = CType(resources.GetObject("MenuItem7.Visible"), Boolean)
'
'MenuItem13
'
Me.MenuItem13.Enabled = CType(resources.GetObject("MenuItem13.Enabled"), Boolean)
Me.MenuItem13.Index = 0
Me.MenuItem13.Shortcut = CType(resources.GetObject("MenuItem13.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem13.ShowShortcut = CType(resources.GetObject("MenuItem13.ShowShortcut"), Boolean)
Me.MenuItem13.Text = resources.GetString("MenuItem13.Text")
Me.MenuItem13.Visible = CType(resources.GetObject("MenuItem13.Visible"), Boolean)
'
'MenuItem15 '
Me.MenuItem15.Enabled = CType(resources.GetObject("MenuItem15.Enabled"), Boolean)
Me.MenuItem15.Index = 1
Me.MenuItem15.Shortcut = CType(resources.GetObject("MenuItem15.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem15.ShowShortcut = CType(resources.GetObject("MenuItem15.ShowShortcut"), Boolean)
Me.MenuItem15.Text = resources.GetString("MenuItem15.Text")
Me.MenuItem15.Visible = CType(resources.GetObject("MenuItem15.Visible"), Boolean)
'
'MenuItem14
'
Me.MenuItem14.Enabled = CType(resources.GetObject("MenuItem14.Enabled"), Boolean)
Me.MenuItem14.Index = 2
Me.MenuItem14.Shortcut = CType(resources.GetObject("MenuItem14.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem14.ShowShortcut = CType(resources.GetObject("MenuItem14.ShowShortcut"), Boolean)
Me.MenuItem14.Text = resources.GetString("MenuItem14.Text")
Me.MenuItem14.Visible = CType(resources.GetObject("MenuItem14.Visible"), Boolean)
'
'MenuItem8
'
Me.MenuItem8.Enabled = CType(resources.GetObject("MenuItem8.Enabled"), Boolean)
Me.MenuItem8.Index = 4
Me.MenuItem8.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem9})
Me.MenuItem8.Shortcut = CType(resources.GetObject("MenuItem8.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem8.ShowShortcut = CType(resources.GetObject("MenuItem8.ShowShortcut"), Boolean)
Me.MenuItem8.Text = resources.GetString("MenuItem8.Text")
Me.MenuItem8.Visible = CType(resources.GetObject("MenuItem8.Visible"), Boolean)
'
'MenuItem9
'
Me.MenuItem9.Enabled = CType(resources.GetObject("MenuItem9.Enabled"), Boolean)
Me.MenuItem9.Index = 0
Me.MenuItem9.Shortcut = CType(resources.GetObject("MenuItem9.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem9.ShowShortcut = CType(resources.GetObject("MenuItem9.ShowShortcut"), Boolean)
Me.MenuItem9.Text = resources.GetString("MenuItem9.Text")
Me.MenuItem9.Visible = CType(resources.GetObject("MenuItem9.Visible"), Boolean)
'
'MainFormNotifyIcon
'
Me.MainFormNotifyIcon.ContextMenu = Me.MainFormContextMenu
Me.MainFormNotifyIcon.Icon = CType(resources.GetObject("MainFormNotifyIcon.Icon"), System.Drawing.Icon)
Me.MainFormNotifyIcon.Text = resources.GetString("MainFormNotifyIcon.Text")
Me.MainFormNotifyIcon.Visible = CType(resources.GetObject("MainFormNotifyIcon.Visible"), Boolean)
'
'MainFormContextMenu
'
Me.MainFormContextMenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem10, Me.MenuItem11, Me.MenuItem12})
Me.MainFormContextMenu.RightToLeft = CType(resources.GetObject("MainFormContextMenu.RightToLeft"), System.Windows.Forms.RightToLeft)
'
'MenuItem10
'
Me.MenuItem10.Enabled = CType(resources.GetObject("MenuItem10.Enabled"), Boolean)
Me.MenuItem10.Index = 0
Me.MenuItem10.Shortcut = CType(resources.GetObject("MenuItem10.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem10.ShowShortcut = CType(resources.GetObject("MenuItem10.ShowShortcut"), Boolean)
Me.MenuItem10.Text = resources.GetString("MenuItem10.Text")
Me.MenuItem10.Visible = CType(resources.GetObject("MenuItem10.Visible"), Boolean)
'
'MenuItem11
'
Me.MenuItem11.Enabled = CType(resources.GetObject("MenuItem11.Enabled"), Boolean)
Me.MenuItem11.Index = 1
Me.MenuItem11.Shortcut = CType(resources.GetObject("MenuItem11.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem11.ShowShortcut = CType(resources.GetObject("MenuItem11.ShowShortcut"), Boolean)
Me.MenuItem11.Text = resources.GetString("MenuItem11.Text")
Me.MenuItem11.Visible = CType(resources.GetObject("MenuItem11.Visible"), Boolean)
'
'MenuItem12
'
Me.MenuItem12.Enabled = CType(resources.GetObject("MenuItem12.Enabled"), Boolean)
Me.MenuItem12.Index = 2
Me.MenuItem12.Shortcut = CType(resources.GetObject("MenuItem12.Shortcut"), System.Windows.Forms.Shortcut)
Me.MenuItem12.ShowShortcut = CType(resources.GetObject("MenuItem12.ShowShortcut"), Boolean)
Me.MenuItem12.Text = resources.GetString("MenuItem12.Text")
Me.MenuItem12.Visible = CType(resources.GetObject("MenuItem12.Visible"), Boolean)
'
'OdbcDataAdapter1
'
Me.OdbcDataAdapter1.DeleteCommand = Me.OdbcDeleteCommand1
Me.OdbcDataAdapter1.InsertCommand = Me.OdbcInsertCommand1
Me.OdbcDataAdapter1.SelectCommand = Me.OdbcSelectCommand1
Me.OdbcDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "BTTable", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("RecNo", "RecNo"), New System.Data.Common.DataColumnMapping("ID", "ID"), New System.Data.Common.DataColumnMapping("ShipID", "ShipID"), New System.Data.Common.DataColumnMapping("OrderDate", "OrderDate"), New System.Data.Common.DataColumnMapping("CustomerCode", "CustomerCode"), New System.Data.Common.DataColumnMapping("ProductCode", "ProductCode"), New System.Data.Common.DataColumnMapping("Product", "Product"), New System.Data.Common.DataColumnMapping("Measure", "Measure"), New System.Data.Common.DataColumnMapping("CountsOrdered", "CountsOrdered"), New System.Data.Common.DataColumnMapping("Buyer", "Buyer"), New System.Data.Common.DataColumnMapping("Customer", "Customer")})})
Me.OdbcDataAdapter1.UpdateCommand = Me.OdbcUpdateCommand1
'
'OdbcDeleteCommand1
'
Me.OdbcDeleteCommand1.CommandText = "DELETE FROM BTTable WHERE (RecNo = ?) AND (Buyer = ?) AND (CountsOrdered = ?) AND" & _
" (Customer = ?) AND (CustomerCode = ?) AND (ID = ?) AND (Measure = ?) AND (Order" & _
"Date = ?) AND (Product = ?) AND (ProductCode = ?) AND (ShipID = ?)"
Me.OdbcDeleteCommand1.Connection = Me.OdbcConnection1
Me.OdbcDeleteCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_RecNo", System.Data.Odbc.OdbcType.UniqueIdentifier, 16, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "RecNo", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcDeleteCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_Buyer", System.Data.Odbc.OdbcType.VarChar, 15, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Buyer", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcDeleteCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_CountsOrdered", System.Data.Odbc.OdbcType.Double, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CountsOrdered", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcDeleteCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_Customer", System.Data.Odbc.OdbcType.VarChar, 20, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Customer", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcDeleteCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_CustomerCode", System.Data.Odbc.OdbcType.VarChar, 2, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CustomerCode", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcDeleteCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_ID", System.Data.Odbc.OdbcType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ID", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcDeleteCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_Measure", System.Data.Odbc.OdbcType.VarChar, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Measure", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcDeleteCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_OrderDate", System.Data.Odbc.OdbcType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "OrderDate", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcDeleteCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_Product", System.Data.Odbc.OdbcType.VarChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Product", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcDeleteCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_ProductCode", System.Data.Odbc.OdbcType.VarChar, 3, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ProductCode", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcDeleteCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_ShipID", System.Data.Odbc.OdbcType.VarChar, 3, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ShipID", System.Data.DataRowVersion.Original, Nothing))
'
'OdbcConnection1
'
Me.OdbcConnection1.ConnectionString = "DSN=BT;UID=sa;DATABASE=BT;APP=Microsoft® Visual Studio .NET;WSID=ST-01"
'
'OdbcInsertCommand1
'
Me.OdbcInsertCommand1.CommandText = "INSERT INTO BTTable(RecNo, ID, ShipID, OrderDate, CustomerCode, ProductCode, Prod" & _
"uct, Measure, CountsOrdered, Buyer, Customer) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?," & _
" ?, ?); SELECT RecNo, ID, ShipID, OrderDate, CustomerCode, ProductCode, Product," & _
" Measure, CountsOrdered, Buyer, Customer FROM BTTable WHERE (RecNo = ?) ORDER BY" & _
" ID"
Me.OdbcInsertCommand1.Connection = Me.OdbcConnection1
Me.OdbcInsertCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("RecNo", System.Data.Odbc.OdbcType.UniqueIdentifier, 16, "RecNo"))
Me.OdbcInsertCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("ID", System.Data.Odbc.OdbcType.Int, 4, "ID"))
Me.OdbcInsertCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("ShipID", System.Data.Odbc.OdbcType.VarChar, 3, "ShipID"))
Me.OdbcInsertCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("OrderDate", System.Data.Odbc.OdbcType.DateTime, 8, "OrderDate"))
Me.OdbcInsertCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("CustomerCode", System.Data.Odbc.OdbcType.VarChar, 2, "CustomerCode"))
Me.OdbcInsertCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("ProductCode", System.Data.Odbc.OdbcType.VarChar, 3, "ProductCode"))
Me.OdbcInsertCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Product", System.Data.Odbc.OdbcType.VarChar, 50, "Product"))
Me.OdbcInsertCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Measure", System.Data.Odbc.OdbcType.VarChar, 4, "Measure"))
Me.OdbcInsertCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("CountsOrdered", System.Data.Odbc.OdbcType.Double, 8, "CountsOrdered"))
Me.OdbcInsertCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Buyer", System.Data.Odbc.OdbcType.VarChar, 15, "Buyer"))
Me.OdbcInsertCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Customer", System.Data.Odbc.OdbcType.VarChar, 20, "Customer"))
Me.OdbcInsertCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Select_RecNo", System.Data.Odbc.OdbcType.UniqueIdentifier, 16, "RecNo"))
'
'OdbcSelectCommand1
'
Me.OdbcSelectCommand1.CommandText = "SELECT RecNo, ID, ShipID, OrderDate, CustomerCode, ProductCode, Product, Measure," & _
" CountsOrdered, Buyer, Customer FROM BTTable ORDER BY ID"
Me.OdbcSelectCommand1.Connection = Me.OdbcConnection1
'
'OdbcUpdateCommand1
'
Me.OdbcUpdateCommand1.CommandText = "UPDATE BTTable SET RecNo = ?, ID = ?, ShipID = ?, OrderDate = ?, CustomerCode = ?" & _
", ProductCode = ?, Product = ?, Measure = ?, CountsOrdered = ?, Buyer = ?, Custo" & _
"mer = ? WHERE (RecNo = ?) AND (Buyer = ?) AND (CountsOrdered = ?) AND (Customer " & _
"= ?) AND (CustomerCode = ?) AND (ID = ?) AND (Measure = ?) AND (OrderDate = ?) A" & _
"ND (Product = ?) AND (ProductCode = ?) AND (ShipID = ?); SELECT RecNo, ID, ShipI" & _
"D, OrderDate, CustomerCode, ProductCode, Product, Measure, CountsOrdered, Buyer," & _
" Customer FROM BTTable WHERE (RecNo = ?) ORDER BY ID"
Me.OdbcUpdateCommand1.Connection = Me.OdbcConnection1
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("RecNo", System.Data.Odbc.OdbcType.UniqueIdentifier, 16, "RecNo"))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("ID", System.Data.Odbc.OdbcType.Int, 4, "ID"))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("ShipID", System.Data.Odbc.OdbcType.VarChar, 3, "ShipID"))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("OrderDate", System.Data.Odbc.OdbcType.DateTime, 8, "OrderDate"))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("CustomerCode", System.Data.Odbc.OdbcType.VarChar, 2, "CustomerCode"))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("ProductCode", System.Data.Odbc.OdbcType.VarChar, 3, "ProductCode"))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Product", System.Data.Odbc.OdbcType.VarChar, 50, "Product"))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Measure", System.Data.Odbc.OdbcType.VarChar, 4, "Measure"))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("CountsOrdered", System.Data.Odbc.OdbcType.Double, 8, "CountsOrdered"))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Buyer", System.Data.Odbc.OdbcType.VarChar, 15, "Buyer"))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Customer", System.Data.Odbc.OdbcType.VarChar, 20, "Customer"))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_RecNo", System.Data.Odbc.OdbcType.UniqueIdentifier, 16, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "RecNo", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_Buyer", System.Data.Odbc.OdbcType.VarChar, 15, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Buyer", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_CountsOrdered", System.Data.Odbc.OdbcType.Double, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CountsOrdered", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_Customer", System.Data.Odbc.OdbcType.VarChar, 20, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Customer", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_CustomerCode", System.Data.Odbc.OdbcType.VarChar, 2, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CustomerCode", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_ID", System.Data.Odbc.OdbcType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ID", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_Measure", System.Data.Odbc.OdbcType.VarChar, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Measure", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_OrderDate", System.Data.Odbc.OdbcType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "OrderDate", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_Product", System.Data.Odbc.OdbcType.VarChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Product", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_ProductCode", System.Data.Odbc.OdbcType.VarChar, 3, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ProductCode", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Original_ShipID", System.Data.Odbc.OdbcType.VarChar, 3, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ShipID", System.Data.DataRowVersion.Original, Nothing))
Me.OdbcUpdateCommand1.Parameters.Add(New System.Data.Odbc.OdbcParameter("Select_RecNo", System.Data.Odbc.OdbcType.UniqueIdentifier, 16, "RecNo"))
'
'OrderDSet1
'
Me.OrderDSet1.DataSetName = "OrderDSet"
Me.OrderDSet1.Locale = New System.Globalization.CultureInfo("ru-RU")
'
'MainForm
'
Me.AccessibleDescription = resources.GetString("$this.AccessibleDescription")
Me.AccessibleName = resources.GetString("$this.AccessibleName")
Me.AutoScaleBaseSize = CType(resources.GetObject("$this.AutoScaleBaseSize"), System.Drawing.Size)
Me.AutoScroll = CType(resources.GetObject("$this.AutoScroll"), Boolean)
Me.AutoScrollMargin = CType(resources.GetObject("$this.AutoScrollMargin"), System.Drawing.Size)
Me.AutoScrollMinSize = CType(resources.GetObject("$this.AutoScrollMinSize"), System.Drawing.Size)
Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
Me.ClientSize = CType(resources.GetObject("$this.ClientSize"), System.Drawing.Size)
Me.Controls.Add(Me.MainFormStatusBar)
Me.Enabled = CType(resources.GetObject("$this.Enabled"), Boolean)
Me.Font = CType(resources.GetObject("$this.Font"), System.Drawing.Font)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.ImeMode = CType(resources.GetObject("$this.ImeMode"), System.Windows.Forms.ImeMode)
Me.IsMdiContainer = True
Me.Location = CType(resources.GetObject("$this.Location"), System.Drawing.Point)
Me.MaximumSize = CType(resources.GetObject("$this.MaximumSize"), System.Drawing.Size)
Me.Menu = Me.MainMenu1
Me.MinimumSize = CType(resources.GetObject("$this.MinimumSize"), System.Drawing.Size)
Me.Name = "MainForm"
Me.RightToLeft = CType(resources.GetObject("$this.RightToLeft"), System.Windows.Forms.RightToLeft)
Me.StartPosition = CType(resources.GetObject("$this.StartPosition"), System.Windows.Forms.FormStartPosition)
Me.Text = resources.GetString("$this.Text")
CType(Me.Panel1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.Panel2, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.Panel3, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.OrderDSet1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
Application.Exit()
End Sub

Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
Dim NewMDIChild As New StoreForm
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Width = ClientSize.Width
NewMDIChild.Height = ClientSize.Height
NewMDIChild.Show()
NewMDIChild.WindowState = FormWindowState.Maximized

MenuItem2.Enabled = False
End Sub

End Class

Вот описание второй формы. При нажатии на кнопку второй формы, мне нужно изменить текст на СтатусБаре первой формы...

Public Class StoreForm
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call
End Sub

'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor. Friend WithEvents StoreFormPanelTop As System.Windows.Forms.Panel
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents StoreFormPanelBottom As System.Windows.Forms.Panel
Friend WithEvents StoreFormStatusBar As System.Windows.Forms.StatusBar
Friend WithEvents Panel1 As System.Windows.Forms.StatusBarPanel
Friend WithEvents Panel2 As System.Windows.Forms.StatusBarPanel
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(StoreForm))
Me.StoreFormPanelTop = New System.Windows.Forms.Panel
Me.Button3 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.Button1 = New System.Windows.Forms.Button
Me.DataGrid1 = New System.Windows.Forms.DataGrid
Me.StoreFormStatusBar = New System.Windows.Forms.StatusBar
Me.Panel1 = New System.Windows.Forms.StatusBarPanel
Me.Panel2 = New System.Windows.Forms.StatusBarPanel
Me.StoreFormPanelBottom = New System.Windows.Forms.Panel
Me.StoreFormPanelTop.SuspendLayout()
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.Panel1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.Panel2, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'StoreFormPanelTop '
Me.StoreFormPanelTop.Controls.Add(Me.Button3)
Me.StoreFormPanelTop.Controls.Add(Me.Button2)
Me.StoreFormPanelTop.Controls.Add(Me.Button1)
Me.StoreFormPanelTop.Dock = System.Windows.Forms.DockStyle.Top
Me.StoreFormPanelTop.Location = New System.Drawing.Point(0, 0)
Me.StoreFormPanelTop.Name = "StoreFormPanelTop"
Me.StoreFormPanelTop.Size = New System.Drawing.Size(712, 36)
Me.StoreFormPanelTop.TabIndex = 3
'
'Button3 '
Me.Button3.Dock = System.Windows.Forms.DockStyle.Left
Me.Button3.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.Button3.Location = New System.Drawing.Point(190, 0)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(95, 36)
Me.Button3.TabIndex = 2
Me.Button3.Text = "Button3"
'
'Button2
'
Me.Button2.Dock = System.Windows.Forms.DockStyle.Left
Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button2.Location = New System.Drawing.Point(95, 0)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(95, 36)
Me.Button2.TabIndex = 1
Me.Button2.Text = "Button2"
'
'Button1
'
Me.Button1.Dock = System.Windows.Forms.DockStyle.Left
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup
Me.Button1.Location = New System.Drawing.Point(0, 0)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(95, 36)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Button1"
'
'DataGrid1 '
Me.DataGrid1.DataMember = ""
Me.DataGrid1.Dock = System.Windows.Forms.DockStyle.Fill
Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.DataGrid1.Location = New System.Drawing.Point(0, 36)
Me.DataGrid1.Name = "DataGrid1"
Me.DataGrid1.Size = New System.Drawing.Size(712, 237)
Me.DataGrid1.TabIndex = 4
'
'StoreFormStatusBar '
Me.StoreFormStatusBar.Location = New System.Drawing.Point(0, 251)
Me.StoreFormStatusBar.Name = "StoreFormStatusBar"
Me.StoreFormStatusBar.Panels.AddRange(New System.Windows.Forms.StatusBarPanel() {Me.Panel1, Me.Panel2})
Me.StoreFormStatusBar.ShowPanels = True
Me.StoreFormStatusBar.Size = New System.Drawing.Size(712, 22)
Me.StoreFormStatusBar.TabIndex = 1
Me.StoreFormStatusBar.Text = "StatusBar1"
'
'Panel1 '
Me.Panel1.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring
Me.Panel1.MinWidth = 75
Me.Panel1.Text = "AAA"
Me.Panel1.Width = 496
'
'Panel2 '
Me.Panel2.MinWidth = 75
Me.Panel2.Text = " No 2"
Me.Panel2.Width = 200
'
'StoreFormPanelBottom '
Me.StoreFormPanelBottom.Dock = System.Windows.Forms.DockStyle.Bottom
Me.StoreFormPanelBottom.Location = New System.Drawing.Point(0, 203)
Me.StoreFormPanelBottom.Name = "StoreFormPanelBottom"
Me.StoreFormPanelBottom.Size = New System.Drawing.Size(712, 48)
Me.StoreFormPanelBottom.TabIndex = 5
'
'StoreForm '
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(712, 273)
Me.Controls.Add(Me.StoreFormPanelBottom)
Me.Controls.Add(Me.StoreFormStatusBar)
Me.Controls.Add(Me.DataGrid1)
Me.Controls.Add(Me.StoreFormPanelTop)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "StoreForm"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Sandelis"
Me.StoreFormPanelTop.ResumeLayout(False)
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.Panel1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.Panel2, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)

End Sub

#End Region


Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

MainForm.MainFormStatusBar.Panel1.text = "new text"
End Sub

Protected Overrides Sub Finalize()
MyBase.Finalize()
End Sub
End Class


Мне вообще интересно как из одной формы обращаться к элементам другой формы, может я чего-то не понимаю?
...
Рейтинг: 0 / 0
09.08.2004, 11:02
    #32640447
marvan
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как в VB из одной формы обратиться к элементам другой формы?
!!!
...
Рейтинг: 0 / 0
09.08.2004, 11:17
    #32640489
raur
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как в VB из одной формы обратиться к элементам другой формы?
Public Class MainForm
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "...

?
ты где такого дизайнера нашел? подобное я видел только на VB.NET
это точно VB 6.0?
...
Рейтинг: 0 / 0
09.08.2004, 11:55
    #32640607
V-Imir
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как в VB из одной формы обратиться к элементам другой формы?
В том то и дело что :( VB.NET Я просто подумал, может у VB 6.0 и у VB7.0 синтаксис похожий... Хотя глупо было надеятся, ведь Дельфи 8 от Дельфи 7 тоже как небо и земля отличаются... И тем не спасибо за потраченное время...
Может кто подскажет про VB.NET где можно почитать?
...
Рейтинг: 0 / 0
09.08.2004, 12:00
    #32640621
raur
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как в VB из одной формы обратиться к элементам другой формы?
V-ImirВ том то и дело что :( VB.NET Я просто подумал, может у VB 6.0 и у VB7.0 синтаксис похожий... Хотя глупо было надеятся, ведь Дельфи 8 от Дельфи 7 тоже как небо и земля отличаются... И тем не спасибо за потраченное время...
Может кто подскажет про VB.NET где можно почитать?

попытка не пытка
напиши на VB 6.0 и конвертируй на VB.NETе, там мастер есть
...
Рейтинг: 0 / 0
10.08.2004, 14:06
    #32642692
hunter79
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Как в VB из одной формы обратиться к элементам другой формы?
В VB 6.0 это возможно следующим образом. Поскольку модули формы закрыты (Private), нужно написать код для обращения к элементам формы через свойства, напр.:

Form1:

TextBox1 - элемент формы

тогда в модуле формы пишем:

Public Property Let TBox1(ByVal Value As String)
TextBox1.Text = Value
End Property

Public Property Get TBox1() As String
TBox1 = TextBox1.Text
End Property

Form2 (из которой вызываешь):

Form1.TBox1 = 'Вот это да?!.'
...
Рейтинг: 0 / 0
Форумы / Visual Basic [игнор отключен] [закрыт для гостей] / Как в VB из одной формы обратиться к элементам другой формы? / 10 сообщений из 10, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]