Pages Menu
TwitterRssFacebook
Categories Menu

Posted by on 17th March, 2011

Hyperlink in RichTextBox

Hyperlink in RichTextBox

Today I learned that the default C# RichTextBox control does not handle hyperlinks out of the box. Wait, it doesn’t..? How is that possible? Yes, hard to believe. So, two hours later, I found a workaround: if you do want to have hyperlinks work, you need to do the following: First, set the DetectUrls property on the RichTextBox control to True. Then, open the Designer.cs file and find the generated code block for the RichTextBlock properties and handlers. Add the following line: Add RichTextBlock handler this.myRichTextBox.LinkClicked += new LinkClickedEventHandler(this.myRichTextBox_LinkClicked); Add the Eventhandler method Add RichTextBlock handler method private void myRichTextBox_LinkClicked(object sender, LinkClickedEventArgs e) { system.Diagnostics.Process.Start(e.LinkText); } That is...

Read More

Posted by on 6th March, 2011

nopCommerce Ecommerce platform

nopCommerce Ecommerce platform

While researching options for a shopping cart module for an ASP.NET application, I came across several packages. Of course, I had already gone through the list of the popular players in this market: dotshoppingcart vevocart znode volusion aspdotnetstorefront Microsoft Commerce Server. And there are likely several more. However, most of these listed carry a hefty price tag and the ones that don’t just didn’t feel like the right choice for the app I am developing, based on reviews of developers who have had to work with them. However, one package, NopCommerce, impressed me out of the box: it is an open source e-commerce solution that is based on ASP.NET 4.0 and installs using Microsoft Web Platform Installer (in my case, on Arvixe Hosting). I was able to use it right away and the list of customizable features and options is vast. The jury is still out until I play with it some more, but from my initial research, this is the one I will be using for this project....

Read More

Posted by on 12th February, 2010

Silverlight Validation & Tooltip Styles…

Silverlight Validation & Tooltip Styles…

Silverlight 3 comes with built-in validation for many of the input controls. Setting them up is fairly easy and they are styled well enough that you could use them right out of the box. If you would like to know how to set it up and also would like to customize the look and feel of the fields and validation message, this short tutorial will explain how to do just that. Silverlight...

Read More

Posted by on 18th January, 2010

Wavelength to Colors

Wavelength to Colors

I did a short experiment several years back on Wavelengths and colors. I was working for Beckman Coulter on their latest Flow Cytometer, which involved working with dozens of lasers of different wavelengths. These lasers would be reflected and filtered to obtain different wavelengths and this needed to be displayed to the user in an intuitive UI. Back then, I wrote a little Windows application that would convert the wavelength to RGB colors, for my reference. I figured I could take the same approach and make it a Silverlight application and here it is… As you can see from the code I am using a PolyBezierSegment and modifying the location of the three points of each wave when the trackbar slider is moved. The corresponding wavelength in nano meters corresponds to the actual color of the light wavelength. The watermarked curves mark the margins of the visible spectrum. Go ahead and move the slider below: mainpage.xaml.cs using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using...

Read More

Posted by on 27th September, 2009

Another Clock experiment

Another Clock experiment

I seem to be unable to break free form any projects that are somehow related to clocks or watches. This time I saw a YouTube movie about an unique clock with a very creative way of displaying time. It is a design is by Sander Mulder and can be seen here: Continue Time Clock. It allows a single arm that is segmented in three parts, to show the hours, minutes and seconds with each correspondent segment at the same time, and although it may not be very intuitive, it is extremely creative and elegant at the same time. Here is my attempt at re-creating the mechanism of this clock in Silverlight 3.0 … It turned out to be relatively simple, by creating a class for each arm and let the hour arm class contain an instance the minute arm class and the minute arm class an instance of the second arm class. This way I could just spin them around their RenderTransformOrigin and they would maintain their relative position...

Read More

Posted by on 6th July, 2009

Vacheron Constantin watch experiment..

Vacheron Constantin watch experiment..

This morning I ran across an article about some watches and there is one that caught my attention. It is a Vacheron Constantin Mercator America and it is a beautiful watch. A bit pricey, but if I ever have $47.500 that I don’t need, maybe I’ll get it some day. The hands of the clock represent what are called nautical dividers and are used by navigational officers to quickly determine distance and range on a maritime charts. I have used these plenty, so perhaps that explains the fascination with this watch. You can buy the watch here and find some exquisite information here. In the meantime, I could only think that the display was quite interesting, and having a maritime background, I loved the concept and originality of its design. I have added a “seconds” counter that moves along the bottom edge of the numbers as well. This was a relatively easy experiment as one can tell by the code… armhour.xaml.cs using System; using System.Collections.Generic; using System.Linq; using System.Net;...

Read More

Posted by on 27th June, 2009

Web.config inheritance tip…

Web.config inheritance tip…

Mainly writing this entry so I don’t spend hours looking for a solution when I need it again, since I tend to forget rather quickly how exactly I solved a problem. In this case, I have a website that is ASP.NET 3.5 and a folder which contains a different .NET application. I understand that the web.config in the root of the site, will cascade down into the applications within by default. What if our application within uses different settings… how do we prevent the settings in the root to affect the child applications? Well, I learned that this can be accomplished in two parts. First there is a somewhat undocumented trick to instruct IIS that we do not want the settings to be inherited by child applications. You will need to wrap your <system.web> tag in a new tag, named <location> with the attributes as shown below: Web.config inheritance <location path="." inheritInChildApplications="false" > <system.web> [...] </system.web> </location> Note that this will show a red squigly line in Visual Studio...

Read More

Posted by on 15th March, 2009

Silverlight 2.0 Moonlander game…

Silverlight 2.0 Moonlander game…

It has been a while since I have posted an experiment and mostly because I have been quite busy and maybe the little project I started was a bit more than just an afternoon (as is usually the case…). I really wanted to write a simple 1980’s type of game, such as asteroids, but someone had already done that in silverlight. So I figured I’d try something else, like the 1980’s Moonlander arcade game. I know that writing a game is much more than just an experiment as it has much more to handle than just a single purpose. I have several times considered scrapping it altogether and starting on something else, but after many weeks on the back burner, I figured, I’d just get it over with and finish it. I have to say that the hardest part here was the collision detection and the gravity calculation. I was shockingly surprised that Silverlight 2.0 does not have an obvious built-in HitTest or collision detection method for individual objects...

Read More

Posted by on 22nd January, 2009

More free stuff from DevExpress…

More free stuff from DevExpress…

In a previous post I had mentioned about 60 free .NET components available at no cost at all. These are high quality controls and I still have to try many of them. Well, looking for a Silverlight Datagrid, I came across Devexpress again and noticed they are offering these two compoent sets for free, including their source code. Silverlight Datagrid Control – here Silverlight Menu – Toolbar controls – here I used to love Xceed andComponentOne controls, but they are expensive and Devexpress has become one of my favourites since they make it nearly impossible not to try/use their components and become a fan of them… I just thought I’d post this, because there aren’t many Silverlight Datagrid controls and this one is free. I will likely be doing some experiments with these controls, as soon as I am done with another Silverlight experiment I am working...

Read More

Posted by on 25th December, 2008

Another Silverlight clock experiment…

Another Silverlight clock experiment…

I started working on enhancing the previous Silverlight 2.0 clock I had made, en then I saw a Flash implementation of another creative approach of a clock and wondered if I could do that in Silverlight. Needless to say, I started working on it immediately and below is the result. This is another experiment that I thought I could do in just a few hours and it ended up taking me a bit more. Mostly because of the uneven conversions between the units and the different sizes between the boxes. Anyways, in a nutshell here is my approach: I have a very simple XAML file with only defining seven empty canvasses as placeholders, organized from top to bottom by a StackPanel. I will create and populate every single object dynamically and on the fly: I have a single method (CreateBasicCancas) that generates all the textBoxes for each individual gear. Then I have a single Storyboard that iterates every millisecond and that storyboard calls one single method (MoveGears) for all...

Read More