Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. "object" problem

"object" problem

Scheduled Pinned Locked Moved C#
helpcsharp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kakarato
    wrote on last edited by
    #1

    I try to build a Form template in VB.Net so later on i can inherit the form template. in VB.NET i can use Public SearchForm As Object; 'Without instance the real SearchForm Class object 'The real SearchForm will be instance in the inherit form. 'in the init. method SearchForm.Show(); the base class sucessfully Compile. But in C# public object SearchForm 'Without instance the real SearchForm Class object 'The real SearchForm will be instance in the inherit form. 'in the init. method SearchForm.Show() but in C# i can't compile it.. an error message come out : 'object' does not contain a definition for 'Show' :(Please help ... urgent ...

    K 1 Reply Last reply
    0
    • K kakarato

      I try to build a Form template in VB.Net so later on i can inherit the form template. in VB.NET i can use Public SearchForm As Object; 'Without instance the real SearchForm Class object 'The real SearchForm will be instance in the inherit form. 'in the init. method SearchForm.Show(); the base class sucessfully Compile. But in C# public object SearchForm 'Without instance the real SearchForm Class object 'The real SearchForm will be instance in the inherit form. 'in the init. method SearchForm.Show() but in C# i can't compile it.. an error message come out : 'object' does not contain a definition for 'Show' :(Please help ... urgent ...

      K Offline
      K Offline
      Kai Radewald
      wrote on last edited by
      #2

      That's obvious: "'object' does not contain a definition for 'Show'". The type object does not provide a method called Show. Your variable SearchForm must be of type Form, which provides this method.

      K 1 Reply Last reply
      0
      • K Kai Radewald

        That's obvious: "'object' does not contain a definition for 'Show'". The type object does not provide a method called Show. Your variable SearchForm must be of type Form, which provides this method.

        K Offline
        K Offline
        kakarato
        wrote on last edited by
        #3

        Thanks. You are right, at the base class the 'object' don't have "Show" method. The "SearchFrom" only instance in the inheritted form but not in the class.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups