[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 192
  • Last Modified:

How can i know when my .NET component is loaded in IDE on runs in PE app

I have build my first .NET component. To make a licence system i need in it a solution which can detect when it's in desing environment or when it runs in exe.
Is there events which fires on IDE only ? (VB 6.0 had UserControl_InitProperties() for this)

Matti
0
Matti
Asked:
Matti
  • 4
  • 3
2 Solutions
 
ctm5Commented:
This might do it:

If System.Diagnostics.Debugger.IsAttached then
     'we're under the IDE
End If
0
 
gbzhhuCommented:
what about testing
if this.DesignMode then
    ....
End If

You obviously have design mode controls in order to be interested in design mode
0
 
MattiAuthor Commented:
ctm5:
I did get this working but it only meet the condition in debuger.
However I was able to stop the debuging process.
What I want is the IDE when someone loads my component there.
So it's a bit spare like solution in this.  

gbzhhu:
I was not able to do anyting whit this
I did open the object browser and i found System.ComponentModel.Design but there was a prompt can't use as expression.
Could you give me the complete line how to test against it is it loading in the IDE.

Matti
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
gbzhhuCommented:
Sorry forgot this is a VB TA

Try that

if Me.DesignMode then
    ....
End If
0
 
MattiAuthor Commented:
Hi!

I don't get it working,  i had it in Sub New() inside on my component project.

Matti
0
 
gbzhhuCommented:
what do you mean?  do you get an error or does it always return false?
0
 
MattiAuthor Commented:
Returns always false
0
 
gbzhhuCommented:
That case I am not sure why
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now