I am in the middle of creating a form that will work with Tablet PCs. But right now i need to see what are the best practices that one can have when creating them. When i am creating forms i am referring to the forms where a user fills in data presses next it is similar to a survey application.
Does anyone have any helpful links or even suggestions that will help me understand the best practices for tablet PCs?
Although this isn't directly C# related, I found it to be a fine example of how to do forms for Tablets in the manner you describe, where the user can hit the Next or Back button to navigate thru a form in a user-friendly environment: http://jqtouch.com/
I just started converting a site that was designed for Tablet users earlier today and managed to finish about a 20+ field form to the point where I'm ready to plug in the existing .NET form fields first thing on Monday. If I can, I'll post an example after it's ready to go
Just create a next form & On Button_Click require.FormName & Form1.Visible=false
So a next form will open with different options,etc and the fist form will hide so it will look like a different page.
Related
Newbie here.
I am trying to create an app for a local library and was hoping to be able to have the synopsis of the book show up when you click on the synopsis button. I would like it to show different information depending on which record is being shown. Is this something that is possible to do?
Thank you community!
Megan
Library App User Interface:
I have two different form applications. One form Application opens my camera and captures my head gesture, and the other application is just a game. Both the program run perfectly separately. All I need to know is how to merge this application. In short I want to run both at a time. The reason is I need to control the game application with my head gesture. There is not any code to add because I have not merge them so no error log as well. Please help me out to do this. Thanks
You need to create one windows form application which has a single form and include both forms in this app side by side. Make sure that you have all assets to be copied along with the forms otherwise you will face error outputs and design time errors.
adding both forms is into same layout is just by adding them as sub component in your new layout.
In Android when finished with an Activity and want to return to previous activity you use finish();.
Is there an equivalent in WinForms using C#? In my application once the user clicks the Enter button I want the user to return to previous window.
Base on a superficial understanding of an Activity in Android (sounds like a window element), you just need to call Close on the current window, then the previous one will then move to the foreground.
For future reference however, I would advise you not too create such analogies between two radically different technologies since the life cycle of an Activity in Android is radically different from a form in a Windows Form application. You should try to learn the framework rather than replicating an implementation from a different framework/platform.
I am interested to know how can I do the same thing that the apllication listed below does:
Start Menu Calculator
I want to know how can I create an custom tab in Start Menu Search and then handle it with my WPF application. It should only be enabled until my application is running.( Just like what The calculator does )
I read something about windows API Code Pack and I downloaded it but I don't know how can I use it. I searched through it but I didn't find anything.( If you know how I could do this using with Windows API Code Pack, please write an example that explains how to do it in C#)
The main exe "Start Menu Calculator.exe" installs a windows hook (using SetWindowsHookEx) into explorer.exe. The hook is implemented as usual in SBLib.dll which is then injected into Windows Explorer's memory space.
This hook searches for window handles belonging to the search box. See a discussion around this here:
How do I get a "handle" on the Windows Search textbox? and probably sub classes the search box windows (if you kill the "Start Menu Calculator.exe" process abruptly, it crashes Windows Explorer too... which kinda confirms this)
It then reacts to key presses, and I suppose it butchers up the result window. In the hierarchies of Windows, I think it's a Window named "Desktop Search Open View", you can get to it with SPY++ under "Start Menu", aside the windows mentioned in the msdn forum above.
So, no nice API behind this nice application. Massive hacks instead :-)
I think however, some level of integration is possible, using documented behavior, with the search box. I have not dug further, but there is the notion of federated search in Windows (Windows 7 Federated Search). I don't see if this would be capable of reacting instantaneously to what the user types in though...
As a side note, if you're also looking for a way to run javascript code from C#, there is a question here on SO that says it all: parse and execute JS by C#
When making Start Menu Calculator I initially tried to use federated search and Managed (.NET) code however you can't integrate into the start menu, only the shell search (for web service based search which lets you return custom results based on a search string). The problem is that the federated search is structured such that all the search data is pre-indexed so for the calculator to work I would have had to pre index every possible calculation! The reason it all works this way is to make sure that clicking the start menu is always fast and responsive (you don't want a web service call everytime you press start in the shell).
I ended up hiring someone to write a native windows app that places a IE control into the Start menu search area and passes the searched text in with the source. All the visual stuff is just css made to look like the start menu rendering and the calculations handled in javascript.
So yes, a bit of a hack but it seems to work and I havent had/heard of any crashing issues so far.
So I would consider myself a .Net and ASP.NET pro but I am a bit new to Windows Mobile (I am targeting .net 3.5 CF and Windows Mobile 6).
I am creating a data driven application that will have 3-4 tables. I have created a form for each table that allows the user to search through the table.
Each form inheretes from the Main form so that they each have the same Menu.
My question is how do I make sure that only one Window is open. I want to allow the user to go to the menu and choose a table which will open a new form. What I don't want is for the user to open say each form and then when they are done to have to close 3 or 4 windows. Is this possible? If so how do I do it? On a side note is there a better way to do this. I don't want all my logic on one form. So I don't just want to hide and show and panels.
I keep something I call an application hub that everything goes though.
So each menu click will call the applciation hub, and each form will reference it.
Then, when switching form, the application hub needs to keep track of the current form, close it, then load the requested form.
This isn't much code to write, and performs well.
Or...performance wise, keep the application hub idea, and keep the dialogs open. It will perform better that way, rather than having to reload the forms all the time.
Then on shut down, the application hub can check which forms are open (it should have a reference to each running form) and close them for the user.
Instead of having multiple Forms (inherited form mainForm) you could put the table stuff on UserControls and have total control about their Creation/Destruction/Visibility much easier.
Use an Interface or a BaseUserControl to implement common functionality.
This article, while not exactly what you are asking, was very helpful when I was redesigning a .NET CF application: Creating a Multiple Form Application Framework for the .NET Compact Framework
My application required a bit of both worlds - I wanted to have a single form open, but also sometimes wanted to stack a secondary form on top of the first (eg. if they go to a Prefs page or some other type of form where they should only ever dismiss it after a moment).
(Pseudo-coding after this)
I created a ViewManager and implemented it as a singleton. When the app first launches, I call ViewManager.GotoForm(frm). This sets the current form to be whatever form I need.
Then I immediately call ViewManager.CurrentForm.ShowDialog() - I'm sure there's a better way, but I found I had to call ShowDialog() at SOME point just to get a form to appear.
Subsequent calls to ViewManager can take the form .ReplaceForm or .StackForm. The differences should be fairly intuitive.
What you can also do in a view manager like this is cache forms that aren't being displayed, but probably will be again and have expensive setup costs (for instance, in a data-driven app you might have to query the database to determine the fields or tables to display on a form, and this won't change at runtime).
The trick here is that you never call .Show() or .ShowDialog() anywhere in your application - you route all form navigation through the view manager which handles loading the next instance of your form, disposing of old forms (if not being cached), and dispatching any sort of populate logic if you want to pass new data to a form's UI before it loads.