Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7036893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:28:41+00:00 2026-05-28T01:28:41+00:00

I have been working very hard on figuring this out and just can’t understand

  • 0

I have been working very hard on figuring this out and just can’t understand the events. Can someone help me understand the event process in my code? Or tell me why my image won’t switch when it runs the code?

Declarations of Class and members

Partial Public Class Name
    Implements IChat

Private member As String
Private instanceContext As InstanceContext
Private participant As IChatChannel
Private ostat As IOnlineStatus
Private factory As DuplexChannelFactory(Of IChatChannel)

Inside my Connect Sub

'Construct InstanceContext to handle messages on callback interface. 
' An instance of ChatApp is created and passed to the InstanceContext.
instanceContext = New InstanceContext(Me)

' Create the participant with the given endpoint configuration
' Each participant opens a duplex channel to the mesh
' participant is an instance of the chat application that has opened a channel to the mesh
factory = New DuplexChannelFactory(Of IChatChannel)(instanceContext, "ChatEndpoint")
participant = factory.CreateChannel()

' Retrieve the PeerNode associated with the participant and register for online/offline events
' PeerNode represents a node in the mesh. Mesh is the named collection of connected nodes.
ostat = participant.GetProperty(Of IOnlineStatus)()
AddHandler ostat.Online, AddressOf Me.OnOnline
AddHandler ostat.Offline, AddressOf Me.OnOffline

Sub routines that are supposed to change image

Public Sub Join(ByVal member As String) Implements IChat.Join
    instanceShellProp.imgP2P.Image = Namespace.My.Resources.Offline 
    MsgBox("JOINED OFFLINE")
End Sub

Public Sub Leave1(ByVal member As String) Implements IChat.Leave
    instanceShellProp.imgP2P.Image = Namespace.My.Resources.Disconnected  
    MsgBox("NOT CONNECTED")
End Sub

Public Sub OnOnline(ByVal sender As Object, ByVal e As EventArgs)
    instanceShellProp.imgP2P.Image = Namespace.My.Resources.Online 
    MsgBox("JOINED ONLINE")
End Sub

Public Sub OnOffline(ByVal sender As Object, ByVal e As EventArgs)
    instanceShellProp.imgP2P.Image = Namespace.My.Resources.Offline 
    MsgBox("JOINED OFFLINE")
End Sub

instanceShellProp returns the instance of the Shell that is a MDI container.

All of the images are in the Resources and properly spelled and referenced to. The MessageBox will pop up but the images won’t change, EXCEPT on Join.

I’m not trying to Code Dump, just trying to make sure that you can see what I am looking at and allow you to give better advice.

All help is appreciated!

EDIT

Okay, I find this weird… I feel like I am getting close. When the messagebox is not commented out the image will change, when it is commented out the image doesn’t change.
Any better suggestions on how to get this to work?

Public Sub OnOnline(ByVal sender As Object, ByVal e As EventArgs)
    With instanceShellProp.imgP2P
        .Image = Nothing
        .Visible = True
    End With
    'MsgBox("JOINED ONLINE")
    With instanceShellProp.imgP2P
        .Image = Namespace.My.Resources.Online
        .Visible = True
    End With
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:28:42+00:00Added an answer on May 28, 2026 at 1:28 am

    Added Application.DoEvents() and it allowed it to work. Not sure as to why but if someone could explain that would be awesome! Thanks!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, I have been having a VERY hard time figuring this out. I guess
I have been working on this app for at least 3-4 months and just
I'm using Delphi 2009. In my program, I have been working very hard to
I have been working very hard on several very long views which are attached
Have been working on this question for a couple hours and have come close
I have been working on this sort of ATM (With a maximum of 50
i have been trying very hard to make tinyMCE work on my page. even
I have been working with some Ajax functions. All of them are working very
I am very new to JS, have been working in C/C++ before, I need
I have been working through a very small-scale WPF project in order to familiarize

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.