Groups | Blog | Home
all groups > dotnet windows forms > july 2003 >

dotnet windows forms : dotnetmagic - reference controls between docked forms


dealguy2000 NO[at]SPAM yahoo.com
7/27/2003 1:20:10 PM
I have 2 docked forms using the dotnetmagic docking controls and I
need to have one the forms update a controls on the other. A simple
example would be FormA with a textbox and a button and FormB with a
listbox, both docked with dotnetmagic. When you click on
FormA.Button, it should add the text of FormA textbox to FormB
Listbox. I cannot figure out how to do this and I really need to.
Any help would be great!!

Chris Dunaway
7/31/2003 1:46:27 PM
dealguy2000@yahoo.com (Tom Erskine) wrote in
news:24aa54f0.0307271220.614e2376@posting.google.com:

[quoted text, click to view]

In order for FormA to be able to change the data on a control in FormB,
FormA needs to have a reference to FormB.

Dim LocalFormBReference As FormB


'Some button on FormA causes FormB to be opened
Public Sub OpenFormBButton_Click(...)
LocalFormBReference = New FormB
FormB.Show
End Sub

'This is the button on FormA that updates the listbox on FormB
Public Sub UpdateFormBListBox_Click(...)
LocalFormBReference.ListBox.Items.Add(FormA.TextBox1.Text)
End Sub

Is this what you're looking for?

Chris

--
If you don't like lunchmeat, please remove it from my e-mail address to
dealguy2000 NO[at]SPAM yahoo.com
8/1/2003 6:02:12 AM
Thanks Chris. This is the approach that I was trying, however, the
docked forms in dotnetmagic are not called with a form.show. They are
instead called from within the control. I assume that I just need the
reference that the control is using, but I do not kow how to get it.

[quoted text, click to view]
AddThis Social Bookmark Button