003
03.12.2005, 15:16 Uhr
Uwe
C/C++ Master (Administrator)
|
Hallo, Also ist der Dialog nicht modal.
C++: |
..... Form2 dlg; ..... private void btnNew_Click(object sender, EventArgs e) { dlg = new Form2(); dlg.Show(this); }
private void btnUpdate_Click(object sender, EventArgs e) { // Ueber Invalidate und Update Invalidate(true); dlg.Update(); // reicht aus wenn nur SE neu gezeichnet werden sollen }
private void btnRefresh_Click(object sender, EventArgs e) { Refresh(); // Owner muss bei der Show() Methode gesetzt sein }
|
MSDN:
Code: |
Control.Update Method Causes the control to redraw the invalidated regions within its client area.
There are two ways to repaint a form and its contents: You can use one of the overloads of the Invalidate method with the Update method. You can call the Refresh method, which forces the control to redraw itself and all its children. This is equivalent to setting the Invalidate method to true and using it with Update
The Invalidate method governs what gets painted or repainted. The Update method governs when the painting or repainting occurs. If you use the Invalidate and Update methods together rather than calling Refresh, what gets repainted depends on which overload of Invalidate you use. The Update method just forces the control to be painted immediately, but the Invalidate method governs what gets painted when you call the Update method.
|
-- "Es ist schwierig, ein Programm wirklich idiotensicher zu machen, weil Idioten so genial sind."
Bis dann... Uwe |