Click here to Skip to main content
15,921,837 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problem with redrawing text in a windows form Pin
Darktaz6-May-05 13:34
Darktaz6-May-05 13:34 
GeneralRe: Problem with redrawing text in a windows form Pin
MoustafaS6-May-05 14:15
MoustafaS6-May-05 14:15 
GeneralForm.Hide(), or Form.Close() not working Pin
Jeea6-May-05 10:01
Jeea6-May-05 10:01 
GeneralRe: Form.Hide(), or Form.Close() not working Pin
Dave Kreskowiak6-May-05 12:08
mveDave Kreskowiak6-May-05 12:08 
GeneralNewly created file stays locked Pin
dratcha6-May-05 9:46
dratcha6-May-05 9:46 
GeneralRe: Newly created file stays locked Pin
Colin Angus Mackay6-May-05 10:52
Colin Angus Mackay6-May-05 10:52 
GeneralRe: Newly created file stays locked Pin
dratcha6-May-05 11:18
dratcha6-May-05 11:18 
GeneralForm Show() method hangs, does not display controls Pin
methodincharge6-May-05 7:26
methodincharge6-May-05 7:26 
Basically what I have is a an IM program. I set up a delegate function that monitors messages from a server, and upon a given message coming in, it launches a new message window. I created my own component that extends the PictureBox class which holds info about the user in the list, and one of the components is a pointer to the Message form. If it is null then a new one is created, otherwise it appends the chat messages to the richtextbox. Now my problem is, when the message comes through, I create a new Message form if the pointer is null, set the pointer to the new message, and call message.Show(). This seems to cause the Message form to hang and it doesnt display any of the controls. However if I do ShowDialog() it all works perfectly except only one message gets displayed until the user closes the window, obviously. Any thoughts? I'm thinking it has something to do from where I'm calling it. Here are some snippets of code:

The GraphicComponents.ImageComponent is my extended PictureBox class with the window property that points to an instance of the Message class, or null, of which Window gets or sets.

private static void ProcessTextMessage(string msg)
{
String[] data = msg.Split(':');
String from = data[0];
String message = data[1];

Message msgWindow;
Debug.WriteLine("Message received from: "+from+" MSG {"+message+"}");
foreach(GraphicComponents.ImageComponent member in users)
{
if(member.UserName.Equals(from))
{
if(member.Window != null)
{
msgWindow = member.Window;
msgWindow.AppendData(from,message);
}
else
{
//The Show method is in the constructor, did have it
//here but still did not work
member.Window = new Message(from);
msgWindow.AppendData(from,message);
}
break;
}
}
}

Any thoughts? Thanks.
GeneralRe: Form Show() method hangs, does not display controls Pin
S. Senthil Kumar6-May-05 7:59
S. Senthil Kumar6-May-05 7:59 
GeneralRe: Form Show() method hangs, does not display controls Pin
methodincharge6-May-05 8:46
methodincharge6-May-05 8:46 
GeneralRe: Form Show() method hangs, does not display controls Pin
S. Senthil Kumar6-May-05 20:12
S. Senthil Kumar6-May-05 20:12 
GeneralWindows Form Multiline ListView Pin
rana936-May-05 7:23
rana936-May-05 7:23 
GeneralWinForms Datagrid format based on cell value Pin
Jose Guay6-May-05 7:14
Jose Guay6-May-05 7:14 
GeneralRe: WinForms Datagrid format based on cell value Pin
Polis Pilavas6-May-05 8:14
Polis Pilavas6-May-05 8:14 
GeneralRe: WinForms Datagrid format based on cell value Pin
Jose Guay6-May-05 12:04
Jose Guay6-May-05 12:04 
GeneralRe: WinForms Datagrid format based on cell value Pin
Polis Pilavas6-May-05 12:14
Polis Pilavas6-May-05 12:14 
GeneralOffice Addin C# Pin
Member 18788066-May-05 6:49
Member 18788066-May-05 6:49 
Generalis there any good programmer for that to help me Pin
snouto6-May-05 5:52
snouto6-May-05 5:52 
QuestionDouble-clicking the Desktop opens the Start Menu? Pin
jklucker6-May-05 5:49
jklucker6-May-05 5:49 
GeneralUpdating values in a PropertyGrid Pin
WujekSamoZlo6-May-05 5:23
WujekSamoZlo6-May-05 5:23 
GeneralRe: Updating values in a PropertyGrid Pin
Mathew Hall6-May-05 15:28
Mathew Hall6-May-05 15:28 
Generalnewbie handling user controls click event in form Pin
Chenele6-May-05 5:11
Chenele6-May-05 5:11 
GeneralRe: newbie handling user controls click event in form Pin
Doctor Nick6-May-05 5:53
Doctor Nick6-May-05 5:53 
GeneralRe: newbie handling user controls click event in form Pin
Chenele6-May-05 6:44
Chenele6-May-05 6:44 
GeneralRe: newbie handling user controls click event in form Pin
MoustafaS6-May-05 9:03
MoustafaS6-May-05 9:03 

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.