Results 1 to 2 of 2

Thread: static

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    static

    VB Code:
    1. public class form
    2.     {
    3.         public form()
    4.         {
    5.  
    6.         }
    7.  
    8.         public static void showform(string name,
    9.             Form child,
    10.             frmmain parent)
    11.         {
    12.             foreach(Form t in parent.MdiChildren)
    13.                 if (t.Name == name)
    14.                 {
    15.                     t.Activate();
    16.                     t.WindowState = parent.ChildWindowState;
    17.                     return;
    18.                 }
    19.             child.MdiParent = parent;
    20.             child.WindowState = parent.ChildWindowState;
    21.             child.Show();
    22.         }
    23.     }
    I'm getting, Error 1 Inconsistent accessibility: parameter type 'lguis_0_1_0.frmmain' is less accessible than method 'lguis_0_1_0.awt.form.showform(string, System.Windows.Forms.Form, lguis_0_1_0.frmmain)' F:\ni 2005\lguis_0_1_0\lguis_0_1_0\awt\form.cs 20 27 . This code works fine on 2k2 but got this error message here on beta 2k5.

    I want to know what cause this. Any help? Thanks.

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: static

    hehe it explains it well I believe. It happens I suppose because vs.net 2005 uses a different access level to define forms by default.

    for example your frmMain might be declared as internal class ....
    and right now you're using it in public class form. So if you're referencing it as a variable in a public class, then frmMain should be declared at least as public. Public is more accessible than Internal
    . Internal is only accesible to the stuff in your project, public is accessible to any other project in your solution I believe.

    If you still cant fix it, let me know
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width