Results 1 to 6 of 6

Thread: [RESOLVED] [2008] DesignMode does not work

  1. #1

    Thread Starter
    Frenzied Member vbdotnetboy's Avatar
    Join Date
    Jun 2004
    Location
    Lewisburg, PA "Next year Raiders in the Super Bowl"
    Posts
    1,310

    Resolved [RESOLVED] [2008] DesignMode does not work

    i've searched looking for an answer... i've tried everything and yet Me.DesignMode does not do what it's suppose to do.

    this is the code i have in a usercontrol in the constructor
    vb Code:
    1. If Not Me.DesignMode Then
    2.    DataImport = New Importer 'Error still occurs
    3. End If

    i've tried this
    vb Code:
    1. If Not Me.Site.DesignMode Then
    2.    DataImport = New Importer 'error still occurs
    3. End If

    however as soon as i comment out the initialization of the DataImport everything is freaking happy...


    now for the wonderful twist... which makes no sense...

    if i do this
    vb Code:
    1. If Me.DesignMode Then
    2.    DataImport = New Importer 'doesn't get initialized
    3. End If

    and clean and rebuild the solution the control load with no problem.... however at runtime when i try and call a method in the Importer class it obviously fails because it's not initialized. i'm soon just going to place my initialization in the load event which is not were i really want it, but at least it will work. so i'm hoping someone can shed some light on this.


    this is seriously stressing me out

    Derek - Using VS 2008 99% of the time and VS 2003 1% of the time

    Please Help Us To Save Ana

    ● Helpful Links: DNR TV | Awesome site for tips | Using ADO.NET to work with Excel | Xml Namespace 2.0 Framework Changes|Ultra High Security Password Generator | Mendhak's ADO.NET Tutorial
    ● Code Bank: Random Password Generator | Generic DbProviderFactory Access
    ● Site Work: Bottle Run Xtreme | Spaids Racing.com

    Company I work for - CSSI

    WHEN POSTING PLEASE INDICATE VERSION

    Please use vbcode tags or code tags when posting code
    [highlight=vb]ALL your code goes here[/highlight] or [code]ALL your code goes here[/code]

    If my post helped you in anyway... please be kind and give me some ratings

  2. #2
    Member
    Join Date
    Jul 2007
    Posts
    38

    Re: [2008] DesignMode does not work

    Did you try this?

    VB.NET Code:
    1. If Not Me.DesignMode = True Then

  3. #3

    Thread Starter
    Frenzied Member vbdotnetboy's Avatar
    Join Date
    Jun 2004
    Location
    Lewisburg, PA "Next year Raiders in the Super Bowl"
    Posts
    1,310

    Re: [2008] DesignMode does not work

    yea i tried that still same problem, but thanks for the reply.

    Derek - Using VS 2008 99% of the time and VS 2003 1% of the time

    Please Help Us To Save Ana

    ● Helpful Links: DNR TV | Awesome site for tips | Using ADO.NET to work with Excel | Xml Namespace 2.0 Framework Changes|Ultra High Security Password Generator | Mendhak's ADO.NET Tutorial
    ● Code Bank: Random Password Generator | Generic DbProviderFactory Access
    ● Site Work: Bottle Run Xtreme | Spaids Racing.com

    Company I work for - CSSI

    WHEN POSTING PLEASE INDICATE VERSION

    Please use vbcode tags or code tags when posting code
    [highlight=vb]ALL your code goes here[/highlight] or [code]ALL your code goes here[/code]

    If my post helped you in anyway... please be kind and give me some ratings

  4. #4
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [2008] DesignMode does not work

    Quote Originally Posted by D4rkness
    Did you try this?

    VB.NET Code:
    1. If Not Me.DesignMode = True Then
    Comparing a boolean with another boolean, to create a third boolean that will be evaluated (which will in fact have the same value as the first boolean))..will not do a thing, and is unnecessary.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  5. #5

    Thread Starter
    Frenzied Member vbdotnetboy's Avatar
    Join Date
    Jun 2004
    Location
    Lewisburg, PA "Next year Raiders in the Super Bowl"
    Posts
    1,310

    Re: [2008] DesignMode does not work

    i've been doing some digging and searching on the net, and it looks as though it's a bug that was reported to MS
    https://connect.microsoft.com/Visual...dbackID=107688

    Derek - Using VS 2008 99% of the time and VS 2003 1% of the time

    Please Help Us To Save Ana

    ● Helpful Links: DNR TV | Awesome site for tips | Using ADO.NET to work with Excel | Xml Namespace 2.0 Framework Changes|Ultra High Security Password Generator | Mendhak's ADO.NET Tutorial
    ● Code Bank: Random Password Generator | Generic DbProviderFactory Access
    ● Site Work: Bottle Run Xtreme | Spaids Racing.com

    Company I work for - CSSI

    WHEN POSTING PLEASE INDICATE VERSION

    Please use vbcode tags or code tags when posting code
    [highlight=vb]ALL your code goes here[/highlight] or [code]ALL your code goes here[/code]

    If my post helped you in anyway... please be kind and give me some ratings

  6. #6

    Thread Starter
    Frenzied Member vbdotnetboy's Avatar
    Join Date
    Jun 2004
    Location
    Lewisburg, PA "Next year Raiders in the Super Bowl"
    Posts
    1,310

    Re: [2008] DesignMode does not work

    well i just put the part that i needed into the load event... which still failed, but after placing the Me.DesignMode in the load event it worked... so i'm guessing there's no way that you can determine if a control is in design mode from within the constructor.

    i thought that the designmode property would be initialize when initializecomponents is called, hence one of the reasons the comments say to place any initializing code after that.

    oh well it works now

    Derek - Using VS 2008 99% of the time and VS 2003 1% of the time

    Please Help Us To Save Ana

    ● Helpful Links: DNR TV | Awesome site for tips | Using ADO.NET to work with Excel | Xml Namespace 2.0 Framework Changes|Ultra High Security Password Generator | Mendhak's ADO.NET Tutorial
    ● Code Bank: Random Password Generator | Generic DbProviderFactory Access
    ● Site Work: Bottle Run Xtreme | Spaids Racing.com

    Company I work for - CSSI

    WHEN POSTING PLEASE INDICATE VERSION

    Please use vbcode tags or code tags when posting code
    [highlight=vb]ALL your code goes here[/highlight] or [code]ALL your code goes here[/code]

    If my post helped you in anyway... please be kind and give me some ratings

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