|
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 />
<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 !!!!!!
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 !!!
Please help
Ciao
Marco
|
|
|
|
|
Did you tried to use 'new' :
button1 = new System.Windows.Forms.Button()
Another question: why do you clear them from their parent. You could set them invisible, setting them visible again shoudl work without problem.
I can't test your code, because i've just got Windows CE 4.0.
Ingo
|
|
|
|
|
[quote]
Did you tried to use 'new' :
button1 = new System.Windows.Forms.Button()
[/quote]
I don't need to create a new button..it's already there, I just need to
set it's parent.
Visible works but I need to get 'em off the parent form completely
Thanks for the effort
|
|
|
|
|
Yes I know that it's there. But if you use the constructor there should be no problem. If there is a problem they way you tried, it sounds a little bit like a bug to me. So I would try something different.
Ingo
|
|
|
|
|
Iwant to ask about the combobox, How i can have the opportunity tochoose one of the alternative in the combo without clicking the arrow.
i mean whaen i begin writing the first letters, it gives me all the opportunity inside, So t can choose.
Thanks...
Assaf
|
|
|
|
|
The combo box does not support auto complete, but there are controls around that do, search this site and see what you come up with.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello! I need to make some search in the registry...
I need to find all the keys and the values that include some word, and to delete
them... I know there is a class Registry, but I don't know how to do what I need.
Maybe someone could help me?
Thanks!
|
|
|
|
|
There are the Registry-Class and the RegistryKey Class
You can get all RegistryKey-Names with a funktion in the RegistryKey-Class:
string[] name = Registry.LocalMachine.GetSubKeyNames();
you can open every subkey and on this you can get all SubKeyNames of this Subkey.
So you can look up every Key, Check its values and if you like Delete it with the Funktion DeleteSubKey
Ingo
|
|
|
|
|
These classes are found in the Microsoft.Win32 Namespace of the .NET Framework.
Bikash Rai
|
|
|
|
|
Oh sorry!
I were thinking of WinCE designing. You're totally right. It's in the Microsoft.Win32 namespace
|
|
|
|
|
Hey Guys,
Been playing with MSH & WinFX and put together a little MSH script to build all projects on your machine which you may find helpful (especially for building the samples)
MSH> $files = (dir . *.csproj -Recurse)<br />
MSH> foreach ($file in $files) {<br />
cd $file.Directory.FullName;<br />
msbuild;<br />
}
60% of statistics are made up on the spot
|
|
|
|
|
Because I've been playting with MSH too much lately, here's it in one line
<br />
MSH> ls -recurse -fiter "*.csproj" | foreach { cd $_.FullName; msbuild}<br />
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
Can anybody please help me in resolving this Issue?
I am trying to open and save a file saved on my local computer through XmlDocument in a Smart Client Application which accepts the Xml data from a web service in the form of a string, which I update to a file in my local machine.
Following is the code..
RSMService lRSMService = new RSMService();
InputOutput IOComplianceGroup = new InputOutput();
IOComplianceGroup = lRSMService.GetSpecificData("procGetSanitizerLog",IO.propertyDataset.Tables[0].Rows[0]["StoreId"].ToString(),false);
if (IOComplianceGroup.propertyResult == Result.Success)
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(IOComplianceGroup.propertyXmlDocument.OuterXml);
System.IO.FileInfo FI = new System.IO.FileInfo(path1);
if(FI.Exists == false)
{
FI.Create();
FI.Open(System.IO.FileMode.OpenOrCreate).Close();
}
FI = null;
try
{
xmlDoc.Save(path1);
xmlDoc = null;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
Thanks in advance
Regards,
Ritesh
|
|
|
|
|
Hello,
I want to calc and test the checksum of an COM-library I use in my project. But as I got as AssemblyLocation only the reference to the Interop-file I don't know how to test the checksum of library itself.
Is there a way to get the reference to the DLL behind an interop resource? Does anybody know?
Thanks,
Ingo
|
|
|
|
|
(You've probably found your answer already, but oh well.)
I'm not positive about this (and am too lazy to doublecheck), but I think the wrappers for the COM objecs in the interop assembly will have the CLSID attached to them via attributes. Assuming that, one could then use reflection to grab the CLSID for the COM wrapper being used, then open up the registry key associated with that CLSID and grab the location of the binary.
Example:
For the COM object MyOldCOMObject with CLSID "4C6055D8-84B9-4111-A7D3-6623894EEDB3", the interop assembly should generate something like this class definition:
[Guid("4C6055D8-84B9-4111-A7D3-6623894EEDB3")]
public class MyOldCOMObjectClass : IMyOldCOMObject
{
}
If so, then the registry should have a key like this:
HKEY_CLASSES_ROOT\CLSID\{4C6055D8-84B9-4111-A7D3-6623894EEDB3}\InprocServer32\(Default): C:\MyOldApplication\MyOldCOMServer.exe
-- modified at 0:47 Friday 23rd December, 2005 (CP doesn't seem to like my registry key example, even though preview works.)
|
|
|
|
|
Thanks, that should help me. I found another way, but it's a little bit dirty, so this should be better.
Ingo
|
|
|
|
|
Hi From Australia,
I Have a project that acesses an excel file that I have stored in the bin folder of my project. All I do is click a button and it opens excel - this works fine on the development computer but when I try it on other computers (Slightly Older) the file opens but is locked and read only saying that the file is already open. I can find the file through excel on the computer my program is installed on but not from my program. Any Ideas?
Fast Taxi
|
|
|
|
|
I'm confused. Does it open in a "locked and read only " state or is it that you can't find the file from your program? My guess is that your program is referencing one version of the Excel object on your development machine and the production machine has an older version installed. For example you may have Office 2003 installed on your dev machine (I believe its the Excel 11.0 object) while the production machine has Office 2000 (I think it is Excel 9.0 object). Check to see which version of excel is installed on each machine to see if they match.
"Half this game is ninety percent mental."
- Yogi Berra
If you can read thank a teacher, if you can read in English, thank a Marine.
|
|
|
|
|
i am new at programming in Microsoft Visual Basic 2005 Express Edition.
i have a form (switchboard has multi button to ectain apps) which when i click a button it runs a .exe
(System.Diagnostics.Process.Start("C:\program files\World of Warcraft\WoW.exe")
it all works but i would like to able to put a button which adds apps whotout having to go in vb to edit.
i would also like to know how do i convert my .net v2 to be able to run on a pc without having to install .net v2 (windows xp and 2000)if possible
thanks Patrick
-- modified at 17:25 Sunday 11th December, 2005
|
|
|
|
|
patrick king wrote: i would also like to know how do i convert my .net v2 to be able to run on a pc without having to install .net v2 (windows xp and 2000)if possible
I can't understand why people keep asking this. If it wasn't required, why do you think you need to install it ? There are expensive ways of doing this, none that are cheap, free, or a good idea.
patrick king wrote: it all works but i would like to able to put a button which adds apps whotout having to go in vb to edit.
I guess you're saying you want to add buttons dynamically ? I would say the best way to do this is to add an XML config file which contains the paths to run and the button text you need, then iterate over it on startup and create buttons accordingly. A drop down list is a much better UI for this, no dynamic controls needed.
But why do you need an exe to do this ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
well i have made a form which has button on it which link to different .exe, but i want to be able to add more button when i need E.G. when i install a new game. without going in to Vb. i also want to know how to make this form once completed run when windows start up.
Thanks Patrick
|
|
|
|
|
patrick king wrote: i also want to know how to make this form once completed run when windows start up.
Place a shortcut to your EXE in the startup folder.
patrick king wrote: but i want to be able to add more button when i need E.G.
The best suggestion (without typing code here) is to tell you to take a look at the code that gets created when you add a control to a form in the designer. You have to do all the same stuff, just at run time.
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
|
|
|
|
|
Christian Graus wrote: If it wasn't required, why do you think you need to install it ?
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
|
|
|
|
|
Hello!
I need to show an image on a Form, and not on the designer, but from the code
itself...
How can I do it?
Thanks!
Have a nice day!
|
|
|
|
|
On the Form itself? You could use the BackgroundImage property.
VB.NET
Me.BackgroundImage = New Bitmap("filePath.bmp")
C#
this.BackgroundImage = new Bitmap("filePath.bmp");
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 19:46 Sunday 11th December, 2005
|
|
|
|