2 Replies - 1138 Views - Last Post: 09 September 2010 - 12:52 AM Rate Topic: -----

#1 TechKid  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 82
  • Joined: 04-September 10

I am getting a problem while creating the form..

Posted 08 September 2010 - 10:21 PM

Hi, im pretty new around these forums so sorry if i make a mistake.

but i am having a problem with my program, i have a settings form and a main form the main for collects information from the settings for and stores it into variables (public XXXX as string) but on my Save button it is supposed to save the information in the main form and show the main form. But it get an error on the first line containing: "MainForm.VARIABLE", The innerMessage says it cant create the form or something, but here is the code from my save button:

(I know that this isn't the right block of code because this doesn't really show anything, but if anyother code is required then just tell me and ill post it. The error actually occurs on "MainForm" itself, how do i fix this?)

Error is: An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object.

Dim r As New Random
        MainBot.Max = txt_Max.Text
        If RB_Manually.Checked = True Then
            savedFile = My.Computer.FileSystem.SpecialDirectories.Temp & "\!_Temp\" & r.Next(999, 999999999) & ".txt"
                My.Computer.FileSystem.WriteAllText(savedFile, txt_ManURLs.Text, False)
                MainBot.deleteAfter = True
                MainBot.TheFile = savedFile
        Else
            MainBot.TheFile = txt_FileURL.Text
        End If
        MainBot.Show()
        MainBot.proxyTimer.Enabled = True
        MainBot.Timer1.Enabled = True


Best Regards,

TechKid :)

This post has been edited by TechKid: 08 September 2010 - 10:31 PM


Is This A Good Question/Topic? 0
  • +

Replies To: I am getting a problem while creating the form..

#2 Jack Eagles1  Icon User is offline

  • Pugnacious Penguin (inspired by no2pencil)
  • member icon

Reputation: 183
  • View blog
  • Posts: 1,152
  • Joined: 10-December 08

Re: I am getting a problem while creating the form..

Posted 08 September 2010 - 11:14 PM

Please stop making forum bots.
Was This Post Helpful? 0
  • +
  • -

#3 emresutisna  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 21
  • View blog
  • Posts: 80
  • Joined: 14-May 09

Re: I am getting a problem while creating the form..

Posted 09 September 2010 - 12:52 AM

It happens because you've never made any instance/ object of the Mainform.
This is the example how to make an instance of Form :
Dim FrmMain As New MainForm
FrmMain.Text = "This Is Main Form"
FrmMain.Show()


Hope it helps.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1