I want to display data on a Windows Forms project in C#.
The general sketch for the GUI is similar to Acrobat Reader or MS Word - meaning i want to display the data on several pages, and let the user navigate between the pages. The data i`m displaying isn't special, i just want to give the user a "page" feeling when viewing it.
I`m searching for a good starting point, preferably open-source.
I thought about using some kind of a reporting tool, such as Crystal Reports, is that a good idea?
Also, is better to use WPF then WinForms for this?
Any thought and recommendations are welcome.
Thanks.
It sounds like you would be better off going the WPF route. You have MUCH better control over how your "form" looks.
What you would want to do is define each "page" in a user control or something, then you can display each one however you like. WPF can handle the zooming for you, all you have to do is hook it up (look into transforms). I can't see WinForms doing this. I would suggest looking at this project on codeplex.
If this project is just for fun, and if you already are using Visual Studio 2008, then WPF is a good choice for this.
If you intend to make this a commercial project, however, I would recommend making it a WinForms application. WPF requires Visual Studio 2008 and .Net 3.5. Many Windows users (especially corporate customers) are still using .Net 2.0 and don't plan to upgrade soon. Some are even still on .Net 1.1 (or no .Net at all). .Net 2.0 comes pre-installed now on new PCs, and the installer for 2.0 is only 23 MB (versus close to 200 MB for the somewhat-buggy .Net 3.5 installer). Also, .Net apps can (potentially) be made to run on Mac, Linux and the iPhone thanks to Mono, but Mono now is somewhere between .Net 2.0 and .Net 3.5, so WPF applications can't be cross-platform yet.
Here is a previous answer to a sort-of-similar question about doing a zoom effect in .Net with GDI+:
Auto sizing zoom on an image in .NET
This should give you a start on doing this kind of graphics work in .Net (and it's as open source as it gets).
Update: If you want to render XPS documents (easily), then you should use WPF. However, this choice would effectively eliminate the possibility of making your application cross-platform via Mono, at least in the short-term.
An alternative would be to export your documents as PDF files, or use Adobe Acrobat to convert your XPS documents into PDF files. Here is a link to a CodeProject sample that renders PDFs entirely in C#/.Net 2.0 or older:
http://www.codeproject.com/KB/showcase/pdfrasterizer.aspx
This code would allow your WinForms application to render a PDF file as a collection of Bitmaps (one for each page), and from there it's a relatively simple matter to display these Bitmaps in the manner you describe (with zoom and everything). Because the project would use .Net 2.0, it should work in Mono without any modifications.
TabControl doesn't do what you want?
It sounds like what your trying to do is make an application behave like a web page. Would just adding a WebBrowser control suffice ?
Related
Is there anything like js lib mxGraph (https://www.draw.io/) availabe for desktop c# apps? (Any GUI)
I know draw.io using mxGraph, which also has Java version, but i didn't find .net implementation. (in fact it has C# renderer, which renders graph to System.Drawing.Image without any interaction support)
I know there is graphviz and graphsharp, but there is no tutorial/user manual like mxGraph has.
I know there is telerik, syncfusion etc controls, but they are paid.
The thing is I need a diagraming tool for my app, and I don't want to invent a wheel.
But it seems like either I stick with undocumented graphsharp or create an Electron app (low perfomace, high memory usage)
This may help https://github.com/prepare/opendiagram .
Open Diagram is a .net diagramming component library for the .Net framework winforms environment.
I use a product that uses this, personally I have no experience in developing with it.
I have requirement that we need to develop a rich UI application(similar to WPF or silverlight). The target device is having embedded OS Win CE 7. how can i achieve this, after so much R&D i got to know that
1. we have to user Silverlight for GUI and C++ as backend coding
2. we can create the MFC application using some third party SDK we will not be able to get rich UI
Also, i read that we can add components in WIN CE 7 for compact framework.
Is my above understanding correct, can someone throw some light on this?
Just to add my 2 cents to Chris and Paolo's replies, if you are not building the OS image for the target device or, at least, can't control the features it supports, your choice may be limited by the set of components that were included into the OS image provided with the device.
Windows CE is highly componentized and both the badly named "Silverlight for Windows Embedded" (XAML) and .NET Compact Framewor runtimes can be left out of the OS image to save storage space and memory.
The XAML runtime can leverage graphic acceleration (if the HW you are using provides it and the BSP includes drivers to use it, of course) and this may lead to a more responsive system, compared to a full .NET implementation.
I would also try to stay away from MFC for new implementation. The only good reason to use MFC is that you already have an UI framework that fit your needs and is based on it.
Currently on CE you can decide between an easy to design and rich UI with complex to develop and debug code-behind (XAML) or an easy to develop .NET application with an ugly windows 95-like UI that require lot of work to be "beautified". XAML in the hand may merge the best of both worlds (requiring additional cost and two heavvy runtimes on your target, but this may not be an issue if you have a powerful x86 machine or a graphic accelerated ARM Cortex).
To develop application on WEC 7 you need an SDK built from OEM that give you the target board.
If you want to develop on a Virtual PC image you need Platform Builder to use CEPC BSP and create an O.S. image and the corresponding SDK.
After that, you can develop using Silverlight only with C++ but you can use .Net Compact Framework and managed code for Windows Forms development.
Paolo.
It really, really depends on both your definition of "rich" and the graphics capability of the hardware you're targeting.
CE 7 supports the .NET Compact Framework. Many people will say that you can't do "rich" UI in the CF, but that's not really true. You can't do it with the standard controls, but if you do your own custom control drawing, you can do pretty well. Yet, it's a lot of work, but it can be done. The limitations here are in alphablending (not fun to get working) and animation (also not fun), but with dedication you can work around many issues.
CE 7.0 also supports "Silverlight for Windows Embedded" (a.k.a. SWE). First thing to know there is that it's really not Silverlight. It's a XAML rendering engine, but any other Silverlight assets you might have won't work with it.
SWE supports only C++, though since it is COM based, it can be wrapped in CF classes and then used from managed code. I've seen a couple of companies do this, and one even offers it as a product.
MFC is available, but since MFC was crap even 10 years ago, I definitely wouldn't use it today. If you want to use C++ but not SWE, there are better options than MFC. STL and WTL come to mind for windowing apps.
I'm browsing the net now for days, but still couldn't find what I'm looking for. Basically I'd like to develop my application interface, the GUI using HTML and CSS, with of course keeping the events, and the chance to modify parts of the layout at runtime (like a content of a div). The application is a database manager displaying visually the datas, and updating them at runtime.
IE aka using System.Windows.Forms.WebBrowser, this is what I try to avoid, it depends on the client system, stops at version 7, hard to link with the application
HTMLayout - http://www.terrainformatica.com/htmlayout/ : seems interesting, but the .net c# part, the nabu-library is dead
Sciter - http://www.terrainformatica.com/sciter/ : from the same group as HTMLayout, but couldn't really understand the integration, and I'm not sure if this is what I want - also couldn't find .net c# infos
Awesomium - http://awesomium.com/ : which really seems nice at first, but it needs .net 4 , and we have to stay at .net 2 - also it seems too much to handle, to use, and .net wiki is a little weak: http://wiki.awesomium.net/
and finally Gecko http://code.google.com/p/geckofx/ and Webkit http://code.google.com/p/open-webkit-sharp/ - but currently I'm not sure that they can be used to render the whole application, they just seem to be a WebBrowser with another engine.
Did I miss something?
Sciter integration principles are outlined here and here.
Sciter and HTMLayout both use the same integration principles and API architecture.
As of .NET wrapper, check these projects:
https://github.com/midiway/SciterSharp
https://code.google.com/p/expemerent/
Not sure if this fits your requirements but I currently use Webkit.NET http://webkitdotnet.sourceforge.net/
Essentially I use its Webkit Browser Control for the interface, store the HTML/CSS markup as variables and then I use C# to perform server-side logic, then output the results to the Browser Control (C# in this case acting in place of PHP since I am not including a portable web server with my application).
I did want to update it to achieve some newer functionality/standards so this article was most helpful.
http://peterdn.com/post/(First!)-Using-WebKit-nightly-builds-with-WebKit-NET.aspx
This is what I need to do.
I must create an ActiveX (IE add-on) in C# to show image(s) on client (load image(s) from Twain Scanner).
I have made Windows Form and use System.Windows.Forms.PictureBox but it need .NET framework installed on client PC.
Any ideas are appreciated. Thanks so much.
Everything written in C# requires .NET framework to run. Either the full framework or Silverlight.
If you want to write an ActiveX that is independent of the .NET Framework you have to write it in another language, such as C++ or Visual Basic 6.
I'd recommend that you really, really, really try to get out of the ActiveX requirement and instead use AJAX or Silverlight.
If you use C# to create an ActiveX control, then yes: it will require the .NET framework at the client. You cannot change that.
If you want a non-.NET control, VB6 (though obsolete) may be simplest. AFAIK Silverlight does not offer access to scanners, so is not an option.
I also suggest, however, that ActiveX itself is already imposing a lot of demands (mainly: IE). I wonder if something like a ClickOnce client application is more appropriate. Or: just provide upload (input type="file") controls.
I have to make an application that runs on both Windows (XP/Vista) and Windows Mobile. The graphics interface must be scalable (for different resolutions) and the controls must be custom (like the ones usually found on music apps).
SVG was my instant choice but the lack of support on Windows Mobile pretty much kill my time budget. I've tried to evaluate WMF and it seems the right answer but i don't really like it.
I was thinking about WPF/XAML but i don't know what are the differences between Windows and Windows Mobile.
The project must be in C# or C++ and it's a commercial project (thus no GPLed libraries).
What would be the best choice? What ma I overlooking?
WinForms has limited support for scaling:
http://sellsbrothers.com/writing/winformsAutoScaling.htm
You may also want to look at "anchor" and "docking":
https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-6165908.html
Combined together you should be able to create a UI that works for both desktop and mobile.
You can do scaling UI in .NET compact framework, like Erwin said with docking and achoring. In the windows mobile applications i have written i do normaly have to write some custom code that deals with things like Font scaling ( Touch founds might need bigger Font then system default if the text should be clickable).
I dont think your going to get it to scale picture correctly without code, i found some question releated that on this site. In my experience i write 99.9% of my code so it runs fine on both windows and windows mobile, but i do make a different UI for windows mobile.
If normaly write code in .NET 2.0 / .NET 2.0 Compact Framework, but if your you dont care about having to install .NET 3 then it should be better ( .NET 2 is wider spread out then .NET 3 )
Another option is the Qt library which is written in C++. It is LGPL which means that it can be used in commercial products without having to release your sources (except for changes to the library itself). If for some reason that isn't good enough they also sell commercial licenses.
It runs on Windows and Windows Mobile. As a bonus if you do a reasonable job of programming (and assuming everything else you're doing coding wise supports it) your application can also be run on Mac OSX, Linux and S60.
It has support for Scalable Vector Graphics, a Canvas with full widget support and a bunch of other nifty features as well! I'd suggest checking out the documentation and seeing if it has everything you need.
Silverlight?