ePlaice / For the Best Software on the Net

Mainly Free and Open Source Software


Software Dev't Navigation

Delphi Conversion | DataSets | DataGridView | Record Navigation | Data Formatting / Validation | Data Queries Data Input Form Data Readers MDI Forms Charts Using MySQL | MySQL NET Connector |

Valid XHTML 1.1

Latest news

27 Feb 2007: I decided to write a few lines about my experiences with C# and SharpDevelop, but got waylaid looking at some of my earlier experiences.

07 Mar 2007: SharpDevelop 2.1 Final has been released.

Links:

MDI Applications

SharpDevelop

The Multiple Document Interface (MDI) is still widely used in many of the top applications, but when I tried to convert an Delphi MDI application to NET 2.0, I hit some unexpected problems which after a little investigation I managed to resolve.

I also found an excellent ribbon control which although it is still undergoing some refinements is still very useable and is the prefect complement to any MDI application. My thoughts are that there is still a lot of life left in the NET 2.0 components and now with an open source ribbon control available, the move to WPF is not always necessary. I have had a look at some of the WPF ribbons available and I would give the one mentioned here full marks for reliability and end result.

MDI Forms

In Delphi building an MDI application is really simple apart from the annoying Action Band fix that never got put in the release to manage sizing the child forms. This sort of petty behaviour was one of the reasons I decided that Delphi was no longer being managed properly. However, to be fair Delphi does not require most of the following because all you need to do is state that the MainForm is an MDIForm and the ChildForm is a Child Form using the property inspector.

Parent Form

The only action required is to set the IsMdiContainer property to true.

Opening a Child Form

If you want to open a new Child Form then call something like this where QueryForm is the name of the child form :-

QueryForm objfrmSChild = new QueryForm();
objfrmSChild.MdiParent = this;
objfrmSChild.Show();
objfrmSChild.BringToFront();

Opening a Child Form from a non Parent Form

I had quite a few situations where I had MDI Child Forms which called up other forms which in turn needed to be MDI Child Forms. For example it was often the case that from a Query Summary Form I needed to call a detail form or a Chart Form. This is a little bit more difficult but easy when you know how :-
First create a static variable to reference the MDI MainForm

public static MainForm staticVar = null;

Then in the MainForm load :-
staticVar = this;

Then when opening the Child Form called QueryDetailForm
QryDetailForm QryYearTrans = new QryDetailForm();
QryYearTrans.MdiParent DaceNet.MainForm.staticVar;

Using Dock

Often in an MDI application you will want the control sitting on a form to resize to the size of the main form when maximizing. This is achieved using the dock property of the control. Mostly - use fill.

Ribbon Control

This is probably not the best place to talk about Ribbon Controls but recently there has been a Ribbon Control developed for NET 2.0 which seems to give a very workable alternative to MenuBars. Previously, I have heard a lot about the Ribbon in association with the later versions of Microsoft Office and at the time dismissed it as a bit of a gimmick - why would anyone want to replace the standard menu layout with an 'adhoc' ribbon menu. How can there be any productivity gains by changing items about - a bit like moving the keys on a keyboard layout!!! However, after younger members of my family informed me of the error of my ways I thought it was time to have another look. Luckily this coincided with a new Ribbon Control just released on the Code Project - the article is titled 'A Professional Ribbon you will Use' (Note there is also a WPF Ribbon Control Library which is available on Code Project but I have not used this so much as I am concentrating on NET 2.0 for my database applications). After trialling the NET 2.0 Control, I can confirm the title is spot on and I am now starting to retrofit some of my applications using this Ribbon as it is already very good and shows great potential as it becomes more polished. Apart from giving this a try I have had a look at charting in OpenOffice Calc and if any application could benefit from a Ribbon Control this is it. Although OpenOffice is a fantastic achievement (probably along with building the Pyramids); nothing is where you would expect to find it. It would be a real pleasure to add a Ribbon control even though by now I have learnt the hard way where some of the functions reside. While on the subject of charting in OpenOffice there are many ways to alter an object - from the menu, by selecting an item and right clicking. Sometimes the application just loses it and it is best to start over.

Purpose of the Ribbon Control

The aim is to allow logical groups of commands to be grouped under tabs so that the user can quickly find the task required. Each tab relates to a type of activity such as creating a chart. In order to reduce clutter certain tabs should be shown only when needed; for example a chart design tab would only be shown if you were building a chart. It should be possible to minimize the ribbon so that only the tab names are showing; by clicking on the tab name the ribbon control should go back to normal size, so that most of the time you can have maximum screen working area. It should also be possible for the user to customize the toolbar so that different groups of commands can be grouped together either just for a particular document or for all documents. So quite a heavy specification and one can see what a software feat it is to get a reliable working demo control.

Ribbon Control and SharpDevelop

A WPF control broke SharpDevelop more than any other application I know and the NET 2.0 application gives it a thorough testing particularly in Design view - OK I was using the version 3.0 Beta 1, but even so I was only using the NET 2.0 features. So these types of applications could form great testing environments for future releases!!! Nevertheless, I persevered and provided I restricted use of the Design view I was able to get a compiled version of my application that worked after a fashion.

Update

Have a look on MenendezPoo.com for further details about using the ribbon and the latest news. There is a black ribbon theme available for those who want something different from the standard blue. Also I have read that there will be a new version available where you can set many of the properties in the design view. An updated version 0.4 is now available which includes new features and improved windows form design features. Some of the features includes the ability to automatically resize the control as the main window is resized. There is also an article showing two different ways to embed the control in the non client area of the window, which some people may find useful. From what I have read and seen the ribbon control supplied here as a free download performs in a very similar manner to theat found in Microsoft Word and Excel. This comes with high recommendations.

HTML Renderer

While I was looking at the Ribbon Control above I came across an HTML Renderer (by the same author). I haven't used it a great deal so far but it looks to be extremely useful. With the renderer you can enter html code and it will faithfully (well nearly) reproduce the text equivalent. It's a bit like having a rich text control but only this one works using html - I can see quite a few applications where this would be very useful.