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

.NET (Core and Framework)

 
QuestionContextMenuStrip and DefaultItem Pin
cual15-Dec-05 7:22
cual15-Dec-05 7:22 
Questionopen forms of an external application? Pin
LordZoster14-Dec-05 11:24
LordZoster14-Dec-05 11:24 
AnswerRe: open forms of an external application? Pin
Dave Kreskowiak14-Dec-05 12:26
mveDave Kreskowiak14-Dec-05 12:26 
GeneralRe: open forms of an external application? Pin
LordZoster14-Dec-05 22:34
LordZoster14-Dec-05 22:34 
AnswerRe: open forms of an external application? Pin
Ingo14-Dec-05 21:36
Ingo14-Dec-05 21:36 
QuestionAssociate File Extension in WinCE 5.0 - CF 1.0 SP2 C# Pin
Marco [Stinger]14-Dec-05 4:55
Marco [Stinger]14-Dec-05 4:55 
AnswerRe: Associate File Extension in WinCE 5.0 - CF 1.0 SP2 C# Pin
Ingo14-Dec-05 21:50
Ingo14-Dec-05 21:50 
QuestionCF 1.0 SP3 - WinCE - FullScreen and Controls.Clear() - Add() Pin
Marco [Stinger]14-Dec-05 2:09
Marco [Stinger]14-Dec-05 2:09 
Hi I'm developping a WinCE 5.0 app using VS 2003, C# and CF 1.0 SP3.
I'm currently testing on the WinCE 4.1 Emulator but a quick check on the
CE 5.0 Device confirmed the behaviour.

I create a full screen Form setting:
<br />
ControlBox = False<br />
FormBorderStyle = None<br />
WindowState = Maximmized


I add 3 buttons (button1, button2, button3) and add the following :

private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
this.Controls.Clear();<br />
}<br />
<br />
private void Form1_Click(object sender, System.EventArgs e)<br />
{<br />
this.Controls.Add(button1);<br />
this.Controls.Add(button2);<br />
this.Controls.Add(button3);<br />
this.Refresh();<br />
// this.Invalidate();<br />
// button1.Invalidate();<br />
// button2.Invalidate();<br />
// button3.Invalidate();<br />
<br />
// this.Invalidate();<br />
// button1.Visible = true;<br />
// button2.Visible = true;<br />
// button3.Visible = true;<br />
// button1.BringToFront();<br />
// button2.BringToFront();<br />
// button3.BringToFront();<br />
}<br />

As you see I clear the controls with the first button and then try to
reasign the 2 controls to the form on the OnClick event of the form.
Guess what happens ?
No controls appear on the first clieck, button2 and button3 on the second
click and all of them on the third click.

But there's more:
The controls don't show, but they are there: I click where I remeber the
control was and I get the button.OnClick event !!!!!! OMG | :OMG: Confused | :confused:

As you see I've tried everithing I know (visible, invalidate, refresh etc
etc) but I allways get the same behaviour.

Do you know how I can get the right behaviour ?

I found a workaround, but I'm still looking for the right solution.
the workaround is:

private void button1_ParentChanged(object sender, System.EventArgs e)<br />
{<br />
(sender as Control).Visible = ((sender as Control).Parent != null);<br />
<br />
}<br />

So the buttons turn invisible after the Controls.Clear() and return visible
after the Controls.Add().

Please note that this is just a TEST APP, the real app must asign
dinamically the controls so Controls.Clear() and Controls.Add() MUST be used

Please Note: if I don't set the FormBorderStyle = None property then
everything works perfectly !!!

WTF | :WTF: WTF | :WTF: WTF | :WTF:

Please help

Ciao
Marco
AnswerRe: CF 1.0 SP3 - WinCE - FullScreen and Controls.Clear() - Add() Pin
Ingo14-Dec-05 3:32
Ingo14-Dec-05 3:32 
GeneralRe: CF 1.0 SP3 - WinCE - FullScreen and Controls.Clear() - Add() Pin
Marco [Stinger]14-Dec-05 4:52
Marco [Stinger]14-Dec-05 4:52 
GeneralRe: CF 1.0 SP3 - WinCE - FullScreen and Controls.Clear() - Add() Pin
Ingo14-Dec-05 21:43
Ingo14-Dec-05 21:43 
QuestionComboBox Pin
Assaf8213-Dec-05 14:24
Assaf8213-Dec-05 14:24 
AnswerRe: ComboBox Pin
Christian Graus13-Dec-05 15:01
protectorChristian Graus13-Dec-05 15:01 
QuestionRegistry search Pin
Yevgeny Efter13-Dec-05 8:57
Yevgeny Efter13-Dec-05 8:57 
AnswerRe: Registry search Pin
Ingo14-Dec-05 1:19
Ingo14-Dec-05 1:19 
GeneralRe: Registry search Pin
HakunaMatada16-Dec-05 0:14
HakunaMatada16-Dec-05 0:14 
GeneralRe: Registry search Pin
Ingo16-Dec-05 0:22
Ingo16-Dec-05 0:22 
QuestionMSH For Building Projects Pin
Joshua Nussbaum13-Dec-05 7:21
Joshua Nussbaum13-Dec-05 7:21 
AnswerRe: MSH For Building Projects Pin
Jared Parsons20-Dec-05 5:48
Jared Parsons20-Dec-05 5:48 
QuestionProblem saving XML file through XmlDocument Pin
Ritesh Mehrotra13-Dec-05 1:41
Ritesh Mehrotra13-Dec-05 1:41 
QuestionMD5 checksum test for COM-DLLs Pin
Ingo13-Dec-05 1:04
Ingo13-Dec-05 1:04 
AnswerRe: MD5 checksum test for COM-DLLs Pin
Phillip M. Hoff22-Dec-05 18:46
Phillip M. Hoff22-Dec-05 18:46 
GeneralRe: MD5 checksum test for COM-DLLs Pin
Ingo28-Dec-05 22:19
Ingo28-Dec-05 22:19 
QuestionVB.Net Excel Pin
fasttaxi12-Dec-05 23:32
fasttaxi12-Dec-05 23:32 
AnswerRe: VB.Net Excel Pin
Brent Lamborn15-Dec-05 4:47
Brent Lamborn15-Dec-05 4:47 

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.