Convertion Object Into Form
-
When i create this programe it will give error Public Class Form1 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 Button1 As System.Windows.Forms.Button Private Sub InitializeComponent() Me.Button1 = New System.Windows.Forms.Button Me.SuspendLayout() ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(64, 80) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(152, 24) Me.Button1.TabIndex = 0 Me.Button1.Text = "Button1" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(292, 273) Me.Controls.Add(Me.Button1) Me.Name = "Form1" Me.Text = "Form1" Me.ResumeLayout(False) End Sub #End Region Dim frmstring As Object = "From2" Dim frm As Form = frmstring Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click frm.show() End Sub End Class
-
When i create this programe it will give error Public Class Form1 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 Button1 As System.Windows.Forms.Button Private Sub InitializeComponent() Me.Button1 = New System.Windows.Forms.Button Me.SuspendLayout() ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(64, 80) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(152, 24) Me.Button1.TabIndex = 0 Me.Button1.Text = "Button1" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(292, 273) Me.Controls.Add(Me.Button1) Me.Name = "Form1" Me.Text = "Form1" Me.ResumeLayout(False) End Sub #End Region Dim frmstring As Object = "From2" Dim frm As Form = frmstring Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click frm.show() End Sub End Class
Dim frmstring As Object = "From2"
Dim frm As Form = frmstringWhat do you think those two lines should do? First you assign the
string
"From2" to theobject
variablefrmstring
. Then you want to assign thisstring
into theForm
variablefrm
. This doesnt make sense and is the cause of the error. -
Dim frmstring As Object = "From2"
Dim frm As Form = frmstringWhat do you think those two lines should do? First you assign the
string
"From2" to theobject
variablefrmstring
. Then you want to assign thisstring
into theForm
variablefrm
. This doesnt make sense and is the cause of the error.That reminds me of one of the mistakes that I made when I was 8 or 9 years old when I was first learning to program and I read that you could make the computer sound in different "voices" (what they meant was altering the sound to emulate basic sounds like some instruments) and I tried to write code replacing the pitch variable with a string and then wondering why it didn't work and didn't say anything. (As luck would have it I got a speech synthesiser for my next birthday so I could get my computer speak some words)
My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
-
That reminds me of one of the mistakes that I made when I was 8 or 9 years old when I was first learning to program and I read that you could make the computer sound in different "voices" (what they meant was altering the sound to emulate basic sounds like some instruments) and I tried to write code replacing the pitch variable with a string and then wondering why it didn't work and didn't say anything. (As luck would have it I got a speech synthesiser for my next birthday so I could get my computer speak some words)
My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
That POS Sinclair had a speech synthesizer? :omg: :-D RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
That POS Sinclair had a speech synthesizer? :omg: :-D RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Dave Kreskowiak wrote: POS :confused: Dave Kreskowiak wrote: Sinclair had a speech synthesizer? No, it was a company called Cheatah (IIRC) that produced a device called the µSpeech that plugged in to the wobbly interface socket on the back of the Spectrum.
My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
-
Dave Kreskowiak wrote: POS :confused: Dave Kreskowiak wrote: Sinclair had a speech synthesizer? No, it was a company called Cheatah (IIRC) that produced a device called the µSpeech that plugged in to the wobbly interface socket on the back of the Spectrum.
My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
POS: "Piece of Fill in your term for excrement here" I can't complain really. I had an old Bally Game Console that had a BASIC cartridge with a WHOPPING 1.8K of RAM. Yes, your heard that right 1.8K. Ever try typing in programs with a keypad that looked like a calculator? From there, I moved up to a TI-99/4A with a speech sythesyzer and the Expansion Unit that was bigger than 2 bread boxes and an additional 32K of RAM. Whoo Hoo! Those were the days! ;) RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome