Click here to Skip to main content
15,903,175 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Hiding & restoring all open forms -- problem Pin
Luc Pattyn10-Jan-08 12:10
sitebuilderLuc Pattyn10-Jan-08 12:10 
GeneralRe: Hiding & restoring all open forms -- problem Pin
Jabes10-Jan-08 22:21
Jabes10-Jan-08 22:21 
GeneralRe: Hiding & restoring all open forms -- problem Pin
Luc Pattyn10-Jan-08 23:46
sitebuilderLuc Pattyn10-Jan-08 23:46 
QuestionHow to restore a form Pin
niradhip8-Jan-08 3:58
niradhip8-Jan-08 3:58 
AnswerRe: How to restore a form Pin
John_Adams10-Jan-08 11:36
John_Adams10-Jan-08 11:36 
QuestionDatagrid Pin
Member 47502137-Jan-08 10:58
Member 47502137-Jan-08 10:58 
GeneralRe: Datagrid Pin
DotNetXenon9-Jan-08 10:50
DotNetXenon9-Jan-08 10:50 
QuestionMDI app with Database access Pin
Gymnast7-Jan-08 8:26
Gymnast7-Jan-08 8:26 
I have an MDI app;
This app has 2 forms Form1 and Form2
Form1 has a ComboBox, ComboBox1, which is bound programmatically to a database;
Form2 has a textbox that should display the combobox selection in Form1.

Essentially, what I would like working is:
In the Form1 Button1_Click event,
Dim f2 as New Form2
f2 = new Form2
f2.TextBox1.Text = Me.ComboBox1.SelectedItem.Text

But this does not work.

So I used a Shared variable to retrieve the value of the combobox selection and use that as the value for the textbox in Form2.

Public Class Class2

Private Shared meetName As String

Public Sub New(ByVal mName As String)
meetName = mName
End Sub
'Assign Combobox selection to the variable, used in the constructor

'Provide access to NameOfMeet Property

Public Shared Property NameOfMeet() As String
Get
Return meetName
End Get
Set(ByVal value As String)
meetName = value
End Set
End Property

End Class

In Form1 Button_Click event:

Dim obj As Class2

Try
'Instantiate Form2
Dim f2 As New Form2
f2 = New Form2

obj = New Class2(Me.ComboBox1.SelectedText)
‘While I have instantiated the Class2 (obj), I have not used it anyplace. Is this right?
f2.TextBox1.Text = Class2.NameOfMeet
f2.Show()
Catch ex As Exception
MsgBox("Error: " & ex.Message)

End Try
End Sub

With this code, I get the following display in the Textbox in Form2 (where I would like the ComboBox selection from Form1 to display) ..
“System.Data.DataRowView”.

Your help is appreciated.

Thanks,

Gymnast
GeneralRe: MDI app with Database access Pin
Kschuler10-Jan-08 10:05
Kschuler10-Jan-08 10:05 
QuestionHow maintain advertisement on kiosk machine [modified] Pin
Prashant kr Yadav (MEC)7-Jan-08 3:36
Prashant kr Yadav (MEC)7-Jan-08 3:36 
AnswerRe: How maintain advertisement on kiosk machine Pin
Christian Graus8-Jan-08 9:18
protectorChristian Graus8-Jan-08 9:18 
GeneralRe: How maintain advertisement on kiosk machine Pin
Prashant kr Yadav (MEC)9-Jan-08 3:13
Prashant kr Yadav (MEC)9-Jan-08 3:13 
GeneralRe: How maintain advertisement on kiosk machine Pin
Pete O'Hanlon10-Jan-08 10:02
mvePete O'Hanlon10-Jan-08 10:02 
Generalusing shellexecuteex to register a dll Pin
iancarter7-Jan-08 0:26
iancarter7-Jan-08 0:26 
QuestionFinding the menu item the mouse is over for help request Pin
earlgraham4-Jan-08 13:03
earlgraham4-Jan-08 13:03 
GeneralRe: Finding the menu item the mouse is over for help request Pin
Kschuler10-Jan-08 9:59
Kschuler10-Jan-08 9:59 
GeneralRe: Finding the menu item the mouse is over for help request Pin
earlgraham10-Jan-08 10:05
earlgraham10-Jan-08 10:05 
General.net remoting Pin
divyesh14323-Jan-08 23:05
divyesh14323-Jan-08 23:05 
GeneralRe: .net remoting Pin
Dave Kreskowiak4-Jan-08 8:38
mveDave Kreskowiak4-Jan-08 8:38 
General2 control units(image buttons) in one datagrid Column Pin
jekak3-Jan-08 5:32
jekak3-Jan-08 5:32 
GeneralRe: 2 control units(image buttons) in one datagrid Column Pin
led mike3-Jan-08 5:54
led mike3-Jan-08 5:54 
GeneralRe: 2 control units(image buttons) in one datagrid Column Pin
jekak3-Jan-08 6:11
jekak3-Jan-08 6:11 
GeneralRe: 2 control units(image buttons) in one datagrid Column Pin
Pete O'Hanlon10-Jan-08 10:05
mvePete O'Hanlon10-Jan-08 10:05 
QuestionCustom Datagridview cell Pin
mp9920053-Jan-08 0:43
mp9920053-Jan-08 0:43 
GeneralRe: Custom Datagridview cell Pin
LongRange.Shooter1-Feb-08 9:57
LongRange.Shooter1-Feb-08 9:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.