Click here to Skip to main content
15,916,835 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionAxHost.AttachInterface not getting called. Pin
rajandpayal23-Mar-10 4:07
rajandpayal23-Mar-10 4:07 
QuestionCHM viewer control? Pin
Xpnctoc22-Mar-10 10:31
Xpnctoc22-Mar-10 10:31 
AnswerRe: CHM viewer control? Pin
Pete O'Hanlon23-Mar-10 11:26
mvePete O'Hanlon23-Mar-10 11:26 
GeneralRe: CHM viewer control? Pin
Xpnctoc24-Mar-10 2:52
Xpnctoc24-Mar-10 2:52 
QuestionSerialization in InitializeComponent -- SOLVED Pin
Gregory Gadow22-Mar-10 8:05
Gregory Gadow22-Mar-10 8:05 
AnswerRe: Serialization in InitializeComponent Pin
Not Active22-Mar-10 10:12
mentorNot Active22-Mar-10 10:12 
GeneralRe: Serialization in InitializeComponent Pin
Gregory Gadow22-Mar-10 12:20
Gregory Gadow22-Mar-10 12:20 
GeneralEUREKA! Pin
Gregory Gadow23-Mar-10 7:15
Gregory Gadow23-Mar-10 7:15 
Lovely town on the northern California coast; I lived theren when I went to college. But in any case, I have a solution. It is based on liron.levi[^]'s article from last year, A Multipanel Control in C#[^]

The answer turned out to be in the designer. In the CodeProject article linked directly above, the AddPage method gets a reference to IDesignerHost, then calls CreateComponent to create a new instance of the object (in this case, an untabbed "tab" panel.) Called without the name parameter, the created object is given a default instance name, which solves a different problem I had been trying to figure out.

My solution for serializing two child controls into InitializeComponent was to replicate this part of AddPage into the Initialize method. The whole method (translated into VB, sorry) looks like this:
Public Overrides Sub Initialize(ByVal component As IComponent)
    MyBase.Initialize(component)

    Dim iccs As IComponentChangeService = _
    DirectCast(GetService(GetType(IComponentChangeService)), IComponentChangeService)
    If iccs IsNot Nothing Then AddHandler iccs.ComponentRemoved, AddressOf ComponentRemoved

    Dim s As ISelectionService = DirectCast(GetService(GetType(ISelectionService)), ISelectionService)
    If s IsNot Nothing Then AddHandler s.SelectionChanged, AddressOf sSelectionChanged

    'Attempt to add two pages
    Dim DH As IDesignerHost = DirectCast(GetService(GetType(IDesignerHost)), IDesignerHost)
    If DH IsNot Nothing Then
        Dim MPP As MultiPanelPage = _
        DirectCast(DH.CreateComponent(GetType(MultiPanelPage)), MultiPanelPage)
        MPP.Text = MPP.Name
        _MPanel.Controls.Add(MPP)
        _MPanel.SelectedPage = MPP

        MPP = DirectCast(DH.CreateComponent(GetType(MultiPanelPage)), MultiPanelPage)
        MPP.Text = MPP.Name
        _MPanel.Controls.Add(MPP)
    End If
End Sub

With this, dropping a MultiPanel control onto a form causes the form's InitializeComponent to declare the control, two autonamed panels, initialize everything and assemble them properly.

If this is confusing, don't worry: I'm working on a simplified version which will become a new article. Poke tongue | ;-P
GeneralArticle Pin
Gregory Gadow29-Mar-10 10:50
Gregory Gadow29-Mar-10 10:50 
QuestionTCP/IP with VB.Net Pin
gymgym_jim22-Mar-10 2:43
gymgym_jim22-Mar-10 2:43 
AnswerRe: TCP/IP with VB.Net Pin
Richard MacCutchan22-Mar-10 4:29
mveRichard MacCutchan22-Mar-10 4:29 
GeneralRe: TCP/IP with VB.Net Pin
gymgym_jim22-Mar-10 4:36
gymgym_jim22-Mar-10 4:36 
GeneralRe: TCP/IP with VB.Net Pin
Richard MacCutchan22-Mar-10 5:22
mveRichard MacCutchan22-Mar-10 5:22 
GeneralRe: TCP/IP with VB.Net Pin
gymgym_jim22-Mar-10 5:35
gymgym_jim22-Mar-10 5:35 
GeneralRe: TCP/IP with VB.Net Pin
Richard MacCutchan22-Mar-10 5:45
mveRichard MacCutchan22-Mar-10 5:45 
AnswerRe: TCP/IP with VB.Net Pin
Аslam Iqbal27-Mar-10 9:05
professionalАslam Iqbal27-Mar-10 9:05 
QuestionDetecting end of HTTP Response Pin
AmitDey19-Mar-10 4:35
AmitDey19-Mar-10 4:35 
AnswerRe: Detecting end of HTTP Response Pin
Dave Kreskowiak19-Mar-10 5:01
mveDave Kreskowiak19-Mar-10 5:01 
GeneralRe: Detecting end of HTTP Response Pin
Ennis Ray Lynch, Jr.19-Mar-10 5:17
Ennis Ray Lynch, Jr.19-Mar-10 5:17 
GeneralRe: Detecting end of HTTP Response Pin
Dave Kreskowiak19-Mar-10 7:12
mveDave Kreskowiak19-Mar-10 7:12 
GeneralRe: Detecting end of HTTP Response Pin
AmitDey25-Apr-10 19:47
AmitDey25-Apr-10 19:47 
AnswerRe: Detecting end of HTTP Response Pin
T M Gray19-Mar-10 7:21
T M Gray19-Mar-10 7:21 
QuestionLicences Key For Windows/Web Application Pin
sreepavan15038518-Mar-10 2:54
sreepavan15038518-Mar-10 2:54 
AnswerRe: Licences Key For Windows/Web Application Pin
Not Active18-Mar-10 3:25
mentorNot Active18-Mar-10 3:25 
AnswerRe: Licences Key For Windows/Web Application Pin
annathor18-Mar-10 21:59
annathor18-Mar-10 21:59 

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.