I maintain a vb.net forms application that prints various labels to label printers. (Label printers are just like any printer, just smaller print area/lower resolution)
The system uses a legacy printing method that's supported in the printer hardware, but has been out of general use for over a decade. I'm adding logic to print from the PrintDocument class. I like the flexibility of the class, but layout is a bit tedious. (Defining the sizes/locations of each DrawString command, etc.)
Are there any software products or open source UI designers for generating print document layout? The designer output must be something I can integrate into my code (dll is OK, just not a separate executable) and can not have a per user license. (Lots of users on my system)
Have a look at this thread Visual Print Design for .NET.
Also, you might consider a PDF template that you can inject with the values, then print the PDF, not perfect, but it could work depending on your needs.
When I looked for a similar need, I ran across some solutions that were marketed as business card designers that looked like it'd fit the bill.
Since what I need is fairly simple I went ahead and rolled my own simple desinger. Found at a great little class that makes controls movable/resizable which saved a bunch of time. Thanks all for the ideas.
Related
Update 2018 TL;DR; LaTEX for WPF
https://github.com/ForNeVeR/wpf-math
Original question
I need to have a way to draw a mathematical formula in Windows Forms or WPF. Some "FormulaTextBox" control would be exactly what I need.
I'm not asking about full implementation of LaTEX, but at least something beyond RichTextBox possibilities, with division lines, square roots, etc.
Here's a list of options, pulled from several webpages online, as well as a few similar questions on SO
WPF-Math, a WPF library for rendering math-related TeX markup.
gNumerator is a WinForms control that renders MathML. It is native C#, but appears to be quite old.
Math Expressions, a commercial WinForms control for displaying and editing math equations. Note: Not free
There's an unofficial port of JMathTex to a C# WPF control
The Windows version of the LaTex editor Lyx uses a native library called MikTex you could take a look at. I saw mention somewhere that the tex4ht package renders math equations to images
MimeTex/MathTex, as you already mentioned
You could also use a WebBrowser control, and just locally include one of many javascript libraries for rendering LaTex.
You could pawn off the work onto Microsoft Word (Example - requires users to have MS Word installed!)
Perhaps you can use the Wolfram Alpha API to retrieve the images.
If you want something beyond a RichTextBox abilities to render pie, divisions and sqr roots and etc, you could just use WebBrowserControl(s) as textbox's. Then to render formula's you could leverage techniques shown in this webpage, save it to your desktop and open the html file:
http://www.wjagray.co.uk/maths/ASCIIMathTutorial.html
Obviously you'll need a special syntax (or special calculator buttons) to enter the formula's and I'm guessing from looking at the customisations.js file driving that webpage that you could make your own list of operators and functions too.
Here's what I'd do if none of the .NET specific solutions work for you:
It's a bit hacky, but it'll work and your users won't know the difference. Download the Mathjax library. When your user enters in the equation, you could convert the equation to LaTex or MathML. You would then take the LaTex or MathML and generate an HTML file that references Mathjax and display the file in your tiny WebBrowser window (valid for both WinForms and WPF). This shouldn't require an internet connection.
Like I said, your users won't be any the wiser.
I have a requirement to present in my c# windows application a "map" of a building, with different rooms coloured in various ways to indicate various things. This needs to be renderable at different sizes and from different perspectives, and needs not to be a one off exercise, but a repeatable process for different establishments.
I am thinking of it in terms of an old school level editor (think old ID stuff), the product of which can be rendered top down; it sounds like an awful lot of work to get into designing my own editing tool, so am looking for a way to hook an existing tool into c#.
I have got the .NET drawing code down (if need be), and I have got the Adobe Illustrator design down (again, if need be) - what I am looking for is a way to link the two, or (if appropriate) a suggestion to use something different in those two roles entirely. Any and all suggestions very gratefully received, thank you!
I'd look at Microsoft Visio - it seems more appropriate for architectural/schematic diagrams than Illustrator and there should be already .NET libraries to use Visio-generated drawings.
Update 2018 TL;DR; LaTEX for WPF
https://github.com/ForNeVeR/wpf-math
Original question
I need to have a way to draw a mathematical formula in Windows Forms or WPF. Some "FormulaTextBox" control would be exactly what I need.
I'm not asking about full implementation of LaTEX, but at least something beyond RichTextBox possibilities, with division lines, square roots, etc.
Here's a list of options, pulled from several webpages online, as well as a few similar questions on SO
WPF-Math, a WPF library for rendering math-related TeX markup.
gNumerator is a WinForms control that renders MathML. It is native C#, but appears to be quite old.
Math Expressions, a commercial WinForms control for displaying and editing math equations. Note: Not free
There's an unofficial port of JMathTex to a C# WPF control
The Windows version of the LaTex editor Lyx uses a native library called MikTex you could take a look at. I saw mention somewhere that the tex4ht package renders math equations to images
MimeTex/MathTex, as you already mentioned
You could also use a WebBrowser control, and just locally include one of many javascript libraries for rendering LaTex.
You could pawn off the work onto Microsoft Word (Example - requires users to have MS Word installed!)
Perhaps you can use the Wolfram Alpha API to retrieve the images.
If you want something beyond a RichTextBox abilities to render pie, divisions and sqr roots and etc, you could just use WebBrowserControl(s) as textbox's. Then to render formula's you could leverage techniques shown in this webpage, save it to your desktop and open the html file:
http://www.wjagray.co.uk/maths/ASCIIMathTutorial.html
Obviously you'll need a special syntax (or special calculator buttons) to enter the formula's and I'm guessing from looking at the customisations.js file driving that webpage that you could make your own list of operators and functions too.
Here's what I'd do if none of the .NET specific solutions work for you:
It's a bit hacky, but it'll work and your users won't know the difference. Download the Mathjax library. When your user enters in the equation, you could convert the equation to LaTex or MathML. You would then take the LaTex or MathML and generate an HTML file that references Mathjax and display the file in your tiny WebBrowser window (valid for both WinForms and WPF). This shouldn't require an internet connection.
Like I said, your users won't be any the wiser.
I'm going to develop a small windows application using C# .NET in VS 2010. The app should read the personnel's data and fill a card layout's fields and then user can click the print button in order to print the card. What is the best solution for printing the card and displaying it to the user?
Like all thing in programming it depends on how much work you want to do. In our app (not sure if I am allowed to post a link, so better not) we take the data from user in a fairly standard form and then use standard graphical style calls to draw the card. This same code can then either draw into an image control for showing to the user OR to a printer device to produce the final output. We have (several) abstraction layers so that the calls for drawing into either type of output are the same.
In general we have found it much more productive to develop our own custom solutions rather than rely on a reporting component. The custom solution is easier to change and in most cases the functionality actually required takes only a day or so of work.
ReportViewerControl http://msdn.microsoft.com/en-us/library/ms251671.aspx is a possible candidate. it is free of charge if you have Visual Studio and it can export the report in PDF too. You can bind to a custom DataSource ( it does not need a Database behind ) and when it's done customizing takes minutes.
my main language is vb/c#.net and I'd like to make a console program but with a menu system.
If any of you have worked with "dos" like programs or iSeries from IBM then thats the style I am going for.
so, was wondering if anyone knows of a "winforms" library that will make my form look like this. I dont mind a "fake winforms look" or a console application but thats how I'd like.
I've used iSeries extensively and I remember exactly what you're talking about. To simulate this look and feel in a C# app, you'll want to create a console project and write text to different areas of the screen with the help of the Console.CursorTop and Console.CursorLeft properties, then calling Console.Write or Console.WriteLine to write out the text in the previously set position. To change colors, before calling WriteLine you'll want to use the Console.ForegroundColor and Console.BackgroundColor properties.
You'll need to listen for input and upon finding a tab character, your program can use its own internal logic to determine where the cursor should appear next (on the next line in the same column, for instance, to simulate those left columns of input fields in your screenshot).
Doing this with a Windows Forms app will be a little trickier and you'd definitely want to write your own control for it (possibly sub-classed from one of the many types of standard multi-line text controls already available).
It's a good question. For many Use Cases the standard Windows (or other windowing) paradigm can be overkill, intimidating, and confusing.
Back in DOS days there were a number of "Windowing" libraries that created various abstractions for doing this.
[After Googling]
Here's a site that lists various libraries including a several that appear to be of interest.
A resource like this would also be handy for Mobile apps, where mouse-driven window apps tend to be not the best fit, especially for workflow-type processes. The Console is a pretty universal lowest-common-denominator abstraction available in most every environment.
You are looking for a curses like library but for windows. And usable from VB & C#.
Curses provides for a even richer text based UI than even iSeries. All sorts of widgetry!
Windows is not really supportive of text interfaces whether on purpose or not so are out of luck.
But ...
Well, how about MonoCurses? I don't know if it will work though. Also look at PDCurses.
And if you don't mind using Python for just the front-end see this.
There are a couple of webifiers or screen scraping programs for iSeries that will create a web or windows user interface on top of your iSeries application. I have never used any of those so there is not a particular one that I can recommend, but you might want to look their for inspiration or reuse.