Forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I apologize for my ignorance of .NET, but my network administrator installed it instead of VB6 and I have some projects that need to be written in a hurry. I can't seem to code any of my projects like VB6. I would like to do several things

1. I would like to concatinate the value of a textbox with a string
sAddendum = "Full_Grant_Num = '" & txtValue & "'
but I get the error Operator '&' is not defined for types 'String' and 'System.Forms.Textbox

2. I have a groupbox and I would like to have a select case on the value of the groupbox, but I get the following error
'Select' expression cannot be of type 'System.Windows.Forms.GroupBox'

How do I go about this. I will be getting some reading material, but I need to get this out the door today

Thank you
 
Brandon said:
I apologize for my ignorance of .NET, but my network administrator
installed it instead of VB6 and I have some projects that need to be written
in a hurry.

Requisition the Corporate Baseball Bat, then go and severely
admonish said "Administrator" severely until he agrees to
reinstall VB Proper. ;-)
I can't seem to code any of my projects like VB6.

No, you can't. Despite it's name, VB.Net is /not/ VB 7; it's a
whole new ball game with a totally different mindset underpinning it.
I would like to concatenate the value of a textbox with a string.
sAddendum = "Full_Grant_Num = '" & txtValue & "'"

Controls no longer have Default Properties. You have to use the
..Text property explicitly, as in

sAddendum = "Full_Grant_Num = '" & txtValue.Text & "'"
I have a groupbox and I would like to have a select case on the
value of the groupbox, but I get the following error.

"Value" of a GroupBox? What would that be? Again, specify the
property you want to use explicitly, as in

Select Case myGroupBox.Text
(every control now has a "Text" property - "Caption" is History...)

HTH,
Phill W.
 
Dim frm as New Form1
frm.Show

or for modal forms:
frm.ShowDialog

Brandon said:
Phil,

Thank you. One more question. In my sub main, I would like to open a form.
The load and show method does not work. How does one open a form in .NET.
 
Brandon said:
Phil,

In my sub main, I would like to open a form. .. . .
How does one open a form in .NET.

Forms are Classes - they always have been; we just didn't need to
know it before ;-) - so you have to create an instance of them to
use them. VB6 used to do this for us, but now we have to do it all for
ourselves.

The other Gotcha is that just loading or showing a form from Sub Main
/isn't/ enough to /keep/ your program running - the form may appear
momentarily, but will then collapse in a heap and disappear.
You need something like this:

Sub Main()
Application.Run( New Form1 )
End Sub

HTH,
Phill W.
 
Back
Top