Click here to Skip to main content
15,890,123 members
Home / Discussions / C#
   

C#

 
AnswerRe: finding unmatched record/data in two sql tables Pin
Sentenryu15-May-12 1:31
Sentenryu15-May-12 1:31 
GeneralRe: finding unmatched record/data in two sql tables Pin
James_201215-May-12 6:08
James_201215-May-12 6:08 
GeneralRe: finding unmatched record/data in two sql tables Pin
James_201215-May-12 7:36
James_201215-May-12 7:36 
GeneralRe: finding unmatched record/data in two sql tables Pin
Sentenryu15-May-12 7:55
Sentenryu15-May-12 7:55 
GeneralRe: finding unmatched record/data in two sql tables Pin
James_201215-May-12 9:08
James_201215-May-12 9:08 
GeneralRe: finding unmatched record/data in two sql tables Pin
ArchimaX16-May-12 4:52
ArchimaX16-May-12 4:52 
GeneralRe: finding unmatched record/data in two sql tables Pin
Sentenryu16-May-12 5:55
Sentenryu16-May-12 5:55 
Answer[Solved] C#/WinForms :: Hosting A Design Surface and IDesignerEventService Pin
Matt U.14-May-12 5:37
Matt U.14-May-12 5:37 
I was reading an article a few minutes ago here on CP that discussed how to host a Form designer. I do not have any particular use for it right now but I was curious. So I got it up and running, it works well and as expected. I began looking around on MSDN for the various things I could do with it, such as the various Service interfaces for the designer. Now I have run into a bit of an issue with one of these services.

I was looking for a way to be notified when a control has been added (via the IToolboxService I created). The only thing I can find, which may be the incorrect method and someone please tell me if so, is the IDesignerEventService. It has events like "ActiveDesignerChanged" and "DesignerCreated". So I figured I could hook the "DesignerCreated" event up and remove the IToolboxService when that event is fired. Here is how I did it:

C#
IDesignerEventService evt = designSurface.GetService(typeof(IDesignerEventService)) as IDesignerEventService;
if (evt != null)
    evt.DesignerCreated += new DesignerEventHandler(evt_DesignerCreated);

//... evt_DesignerCreated(...) ...


However, "evt" ALWAYS has a 'null' value, therefore never being able to receive the desired event. Anyone have an idea why this is happening? I have hooked up other events with no problem but this one is being a PITA. Poke tongue | ;-P

Thanks in advance!


------------------
SOLUTION:

As far as receiving events, I went with Pete's advice and I implemented "IComponentChangeEvent". In order to load/save the form design I was able to "decipher" the article I was reading. This is the article on MSDN. I am close to completing my little test that I have been working on in order to learn more about the subject. Smile | :) Thanks again!
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.


modified 14-May-12 19:46pm.

AnswerRe: C#/WinForms :: Hosting A Design Surface and IDesignerEventService Pin
Pete O'Hanlon14-May-12 6:12
mvePete O'Hanlon14-May-12 6:12 
GeneralRe: C#/WinForms :: Hosting A Design Surface and IDesignerEventService Pin
Matt U.14-May-12 6:54
Matt U.14-May-12 6:54 
GeneralRe: C#/WinForms :: Hosting A Design Surface and IDesignerEventService Pin
Pete O'Hanlon14-May-12 7:18
mvePete O'Hanlon14-May-12 7:18 
GeneralRe: C#/WinForms :: Hosting A Design Surface and IDesignerEventService Pin
Matt U.14-May-12 7:21
Matt U.14-May-12 7:21 
GeneralRe: C#/WinForms :: Hosting A Design Surface and IDesignerEventService Pin
Matt U.14-May-12 7:24
Matt U.14-May-12 7:24 
GeneralRe: C#/WinForms :: Hosting A Design Surface and IDesignerEventService Pin
Pete O'Hanlon14-May-12 8:32
mvePete O'Hanlon14-May-12 8:32 
GeneralRe: C#/WinForms :: Hosting A Design Surface and IDesignerEventService Pin
Matt U.14-May-12 8:39
Matt U.14-May-12 8:39 
Questionusing log4net with custom database logger Pin
SASS_Shooter14-May-12 5:08
SASS_Shooter14-May-12 5:08 
Questioncall a jar file from .net clr Pin
nextaxtion13-May-12 21:40
nextaxtion13-May-12 21:40 
AnswerRe: call a jar file from .net clr Pin
Pete O'Hanlon14-May-12 1:09
mvePete O'Hanlon14-May-12 1:09 
GeneralRe: call a jar file from .net clr Pin
Peter_in_278014-May-12 1:19
professionalPeter_in_278014-May-12 1:19 
GeneralRe: call a jar file from .net clr Pin
Pete O'Hanlon14-May-12 1:43
mvePete O'Hanlon14-May-12 1:43 
Questionhow can i run ~~~.aspx page without popup in c#? Pin
buffering8313-May-12 21:33
buffering8313-May-12 21:33 
AnswerRe: how can i run ~~~.aspx page without popup in c#? Pin
Nitin S14-May-12 1:28
professionalNitin S14-May-12 1:28 
GeneralRe: how can i run ~~~.aspx page without popup in c#? Pin
Sentenryu14-May-12 2:49
Sentenryu14-May-12 2:49 
GeneralRe: how can i run ~~~.aspx page without popup in c#? Pin
buffering8314-May-12 13:33
buffering8314-May-12 13:33 
QuestionStimulsoft Report WinForms in c# (vs2010) Instead CrystalReport Pin
hamed hossani12-May-12 21:40
hamed hossani12-May-12 21:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.