Am I missing some controls for windows mobile? - winforms

I'm a C# developer taking my first steps in Windows Mobile development. I've installed Visual Studio 2008 SP1 and the Windows mobile 6 Pro and Standard SDK's. Now I am trying to create a simple winforms application.
The problem is that when I set the Target Platform to Windows Mobile Standard, I seem to be missing a lot of controls. For example, there is a checkbox, but there isn't even a simple button (take a look at this screenshot ). When I switch to Windows Mobile 6 Professional, I get all kinds of controls.
What could be the problem? I've already tried to repair the WM 6 standard SDK, but that did not help.
Thanks,
Adrian

That's correct. Windows Mobile Standard, also known as Smartphone, doesn't have a touchscreen. All interaction is done through the two menu action buttons. Because of this many controls, like buttons, don't make sense and are therefore filtered from the toolbox.

Related

XAML vs WPF vs Store App vs Phone App vs UWA

I know that XAML is used for designing UI in combination with Blend. I am confused with so many terms, like, how XAML comes into play for WPF, Store App, Phone App or UWA. Morever, what is the difference between WPF, Store App, Phone App and UWA. Does all that means that old Desktop Project will no longer be used and replace by either WPF or Store App or UWA?
When .NET was released in ~2000, you could use WinForms to make desktop applications for Windows. It provides access to 'native' controls (i.e. A Button made in WinForms actually is a Windows Button control from user32.dll) by wrapping the Windows API in managed code. These can run in any version of Windows which has the appropriate .NET framework version installed, including upto Windows 10.
In 2006, WPF was released which is an alternative to WinForms. WPF uses XAML, which is a language based on XML, to declare the user interface elements. In a simple WPF app, the .xaml file describes the GUI and the code-behind file describes the logic. DirectX is used to draw whatever is described in the .xaml into the window.
Like Winforms, programs made using WPF can run in any version of Windows which has the appropriate .NET framework version installed, including upto Windows 10. Note that using XAML is completely optional. Whatever user interface elements you describe using XAML can also be made using your .NET language C# or VisualBasic.NET. But using XAML is usually simpler. See To XAML or not to XAML (MSDN Blogs).
From XAML (Wikipedia) :
As XAML is simply based on XML, developers and designers are able to share and edit content freely amongst themselves without requiring compilation.
From ~2012 along with Windows 8, a new kind of app called metro/modern/windows-8/windows-store-apps can be made. These apps are similar to WPF in that they use XAML for describing the GUI. These apps can run only in Windows 8, 8.1 and Windows 10. Windows 8.1 added some improvements and features but remained mostly the same. The same technology was used to make apps for Windows Phone.
With the release of Windows 10, Microsoft made UWP (Universal Windows Platform) through which you can use the same code base to target differnt kinds of devices (desktop/mobile/xbox/IoT/holographic). These apps made for the UWP are similar to the earlier Windows 8/8.1 apps. Like before, XAML is used to describe the GUI.
Only for the Windows Store apps, there is no backward compatibility. The timeline goes Windows 8 -> Windows 8.1 -> Windows 10/UWP. An app made in UWP can only run in Windows 10 and an app made in Windows 8.1 can not run in Windows 8.
I would highly recommend referring to this discussion thread in stopbyte, it has far more details and explanation of the concepts behind WPF, UWP And WinRT.
As for WinForms, from my experience it's history now. Have been almost replaced by WPF (though it still has mainstream support as mention by #Jazimov).
I'v noticed that Microsoft has stopped improving Windows Forms and probably has stopped maintaining it as well.

Touchscreen Windows 7 WPF

I have an app which I need to make accessible for Windows Touch. It is not a multi-touch application. I've looked at Microsoft's guidelines for touch applications which is interesting. There is one thing I am not clear on though, that is text input.
I would like a keyboard to appear when I click in a TextBox field. Is there a way to use the built-in on screen keyboard for this?
The first monitor I tested with was a Wacom. It is an older unit that uses a pen. It had some software that pulled up an on screen keyboard whenever I clicked in any text field (in any application). It was very handy. I thought this feature was using built-in Windows Tablet software because it didn't look like it came from a third party. A newer monitor I just purchased (Elo) does not have this feature though.
Answering my own question so it won't show up as unanswered any longer... From my comment above:
Looks like I've found the problem. The general purpose driver for the monitor wasn't installing it as a Tablet PC monitor. The Windows 7 only driver will provide a Tablet PC control panel settings. Now a keyboard shows up whenever I click in a TextBox field. The Windows XP compatible driver must have been using a legacy sub-system...

Winforms control spacing in Windows 7

We have an in-house .net 2.0 winforms app currently developed on Visual Studio 2005 in Windows XP. Everyone in the office until now is running Windows XP, and there are no issues.
We recently ordered a new computer with Windows 7 for one of our managers we were hoping to use, and the app installs fine. The issue is the spacing around every label, textbox, and button - making some forms not fit.
Is there some setting that we can use to make Windows 7 display each control where it is placed in our XP development environment and like the rest of our XP clients show?
Ugh, what kind of idiot management team gives a new machine to a manager instead of a programmer?
Control Panel + Display, Advanced tab, change the DPI setting to repro the problem on your XP machine. Read the docs for the Form.AutoScaleMode to find out what's going on.

WPF Controls disappearing in Windows 7?

We have a system built using WPF and have (until recently) been developing using Visual Studio 2008 SP1 and Windows XP SP3.
We have upgraded some of our development boxes to windows 7 and we have discovered we are getting some unexpected behaviour when running our applications. Some controls do not display at all.
Has anybody else experienced issues like these and if so, how can we make them work?
Thanks in advance.
Just a guess I had some similar issues with controls (buttons in my case) that were using the DropShadowEffect. The solution was to switch from DropShadowEffect to DropShadowChrome.

Why do my toolbox items disappear in Visual Studio 2008?

I'm working on a solution that contains multiple projects targeting Windows Mobile 5 and standard Windows applications.
Lately when opening up a form in designer the common UI controls (textbox, button, label, etc etc...) have vanished leaving only the controls defined within the project.
Resetting the toolbox has no effect. A google search suggested deleting the toolbox temp files in the Local Settings\Application Data\Microsoft\VisualStudio\9.0, however this was only successful in bringing back the default controls for Windows Mobile 5. The WinForms controls are still mysteriously missing.
Also, if I right-click and Select All on the toolbox, all of the WinForms controls do in fact come up, however they're all grayed out.
Has anyone else experienced this?
I just had a similiar problem. In a managed C++ project all the default toolbox items disappeared form the winforms designer. After playing around for a while I found that there was a problem in the .vcproj file.
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="COLLADA Import"
ProjectGUID="{0DEEF9B6-1929-44E3-92EC-13712839FB63}"
RootNamespace="COLLADAImport"
Keyword="ManagedCProj"
TargetFrameworkVersion="0"
>
When you set TargetFrameworkVersion to a valid number, for example 131072 for .Net 2.0, the toolbox items will be back.
If you right click on the Toolbox and select 'Choose Items...' and then sort by the 'Namespace' column, you can then select the ones you need (for example System.Windows.Forms for WinForms).
You can multiselect with Shift and then select/deselect the group.
The controls then reappear in the Toolbox as enabled.
I've noticed this exact same thing for regular WinForms as well. I can't speak to mobile applications but in regular winforms this has a tendency to happen.
I believe it's actually a bug in Visual Studio.
There are some things you can do (again, for WinForms. I'm not sure about mobile) with adding attributes to your control. Such as:
[ToolboxBitmap(typeof(MyControl), "MyControlBitmap")]
There are some other useful related things on this site:
http://en.csharp-online.net/Design-Time_Integration-Attributes
I had exactly the same problem (after installing Windows Mobile SDK all items in the toolbox were greyed out).
I've startet the Visual Studio 2008 command line as administrator and started the following command (WARNING - all your settings are lost !!)
devenv /setup /resetuserdata /selfreg /resetskippkgs
After that the toolbox looked fine and worked like on the first day.
The idea came from this thread: connect.microsoft.com
Go to the Tools menu and choose import & export settings, then choose the 'reset all' setting, then yes. Save your current settings, after that you'll have your toolbox reappear.
Actually you may be able to add a registry key to get this to work also.
Make sure you're not in Debug mode.
If you are running Visual Studio 2008 under vista, try running it as an Administrator. Right click on the shortcut and select Run as Administrator.
Well guess what install Service pack 1 for VS 2008 and it would go away and if you have wireless mouse and keyboard turn it off. Choose one of these two both work.

Resources