Click here to Skip to main content
16,005,080 members
Home / Discussions / C#
   

C#

 
GeneralButtons image are all gray on disable mode on a toolbar. Pin
udir23-May-05 1:38
udir23-May-05 1:38 
GeneralrichTextBox print & print preview Pin
gaby2r23-May-05 1:34
gaby2r23-May-05 1:34 
GeneralCrystal Report designer Pin
robmays23-May-05 1:31
robmays23-May-05 1:31 
GeneralRe: Crystal Report designer Pin
robmays23-May-05 2:01
robmays23-May-05 2:01 
GeneralTo send live audio & video data on network. Pin
shumyla198323-May-05 1:08
shumyla198323-May-05 1:08 
GeneralShow() and ShowDialog() Pin
mike chaplee22-May-05 23:39
mike chaplee22-May-05 23:39 
GeneralRe: Show() and ShowDialog() Pin
S. Senthil Kumar23-May-05 0:49
S. Senthil Kumar23-May-05 0:49 
GeneralRe: Show() and ShowDialog() Pin
methodincharge23-May-05 9:36
methodincharge23-May-05 9:36 
I too have come across this seemingly odd error, however the solution is pretty clear once you figure out what's happening. An example solution would be as follows:

private delegate void ShowFormDelegate(string[] details);
...

public PopupFactory()
{
Thread t = new Thread(new ThreadStart(waitForEvents));
t.start();
}

private void waitForEvents()
{
while ( true )
{
lock(al)
{
Monitor.Wait(al);
l.log("got a pulse from another thread on al");
string[] z_details = (string[])al[al.Count - 1];

this.ShowForm(z_details);
}
}
}

public void ShowForm(string[] z_details) {
if(this.InvokeRequired)
{
this.BeginInvoke(new ShowFormDelegate(ShowForm), new object[] z_details});
}
else
{
ZTransparentWindow z = new ZTransparentWindow(z_details[0], z_details[1]);
z.Show();
}
}


Although I haven't tested the code, and therefore cannot guarantee that it works, you should be able to get the idea behind it. I myself am still not QUITE certain why the Show() method doesn't work the way you had it, but I assume it has something to do with the thread that it's being called from. This method guarantees that the form is spawned from the main window. Good luck.

Generalundo in richtext box Pin
hoangsamac22-May-05 23:25
hoangsamac22-May-05 23:25 
GeneralRe: undo in richtext box Pin
mav.northwind23-May-05 0:42
mav.northwind23-May-05 0:42 
QuestionHow to change DataGrid Column's Header's Heigth? Pin
thaibinhla22-May-05 22:18
thaibinhla22-May-05 22:18 
AnswerRe: How to change DataGrid Column's Header's Heigth? Pin
Trivikram Dwivedi22-May-05 23:26
Trivikram Dwivedi22-May-05 23:26 
GeneralRe: How to change DataGrid Column's Header's Heigth? Pin
thaibinhla22-May-05 23:58
thaibinhla22-May-05 23:58 
GeneralRe: How to change DataGrid Column's Header's Heigth? Pin
Trivikram Dwivedi23-May-05 1:20
Trivikram Dwivedi23-May-05 1:20 
GeneralRe: How to change DataGrid Column's Header's Heigth? Pin
thaibinhla23-May-05 14:55
thaibinhla23-May-05 14:55 
QuestionHow to get first object of checked listview Pin
Trivikram Dwivedi22-May-05 22:10
Trivikram Dwivedi22-May-05 22:10 
AnswerRe: How to get first object of checked listview Pin
robmays23-May-05 1:37
robmays23-May-05 1:37 
GeneralRe: How to get first object of checked listview Pin
robmays23-May-05 1:39
robmays23-May-05 1:39 
AnswerRe: I tried this seems ok Pin
robmays23-May-05 1:48
robmays23-May-05 1:48 
Generalpass dataset to new database Pin
sevan22-May-05 21:13
sevan22-May-05 21:13 
GeneralRe: pass dataset to new database Pin
zhengdong jin22-May-05 21:27
zhengdong jin22-May-05 21:27 
GeneralParser Error Message: Could not load type 'talibgroup.Global'. Pin
Murtuza Husain Miyan Patel22-May-05 19:48
professionalMurtuza Husain Miyan Patel22-May-05 19:48 
QuestionHow to Receive Message form other client using RTC API? Pin
Noah_jeal22-May-05 16:54
Noah_jeal22-May-05 16:54 
GeneralRegistry search launch conditions on msi Pin
Asad Hussain22-May-05 16:29
Asad Hussain22-May-05 16:29 
GeneralRe: Registry search launch conditions on msi Pin
Christian Graus22-May-05 17:05
protectorChristian Graus22-May-05 17:05 

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.