Search...

Showing posts with label DotNet. Show all posts
Showing posts with label DotNet. Show all posts

22 October 2009

Creating a readonly Checkbox control

I had to make an ASP.Net checkbox readonly today and found that adding the following :

w.AddAttribute("onClick", string.Format("javascript:{0}.checked = {1};", this.ID, this.Checked.ToString().ToLower()));

to the overridden Render() method of a control that inherits a standard Checkbox control did the trick. The call must be place before the call to the parent classes Render() method.

20 September 2009

London Stock Exchange Migration.

This article from Computerworld covers further developments from the LSE on the migration from a .Net based platform to a Linux/Unix/Oracle based system.

Apparently they liked it so much they brought the company. The full details are in the article,

2 September 2009

NDesk.Options C# Command Args Parser.

I have a small application that I am working on that can receive args passed it's Main() method. While looking for some nicer code than I could conjurer up I found NDesk Options a C# based parser written by Jonathan Pryor which makes parsing args a very easy task.

It has a Git repository which I cloned which includes documentation. It seems a simple but powerful solution to a boring problem.

11 July 2009

London Stock Exchange To Shut Down .Net Based Trading System.

This is an interesting post regarding the software on which the London Stock Exchange runs or rather is about to stop running on.

Obviously the article linked to is an opinion based article however, over the last few years I have been following the development of the system with an interested eye. Performance on .Net applications has always interested me as I have never found ways to make them as fast as a C++ program. When I read that the LSE wanted to develope a real time .Net based system I was interested to see if it could be done. I mean Microsoft developers worked on the system so you would expect if anyone could do it they would be able to. Thats not been the case by the look of it.

1 December 2008

.Net Get Assembly Build Date.

Being of more of a (u)/(l)inux mindset these days I like to include some basic info on apps that I write, even simple 4 line command line applications. In C# I have been trying to create a simple library of functions that I tend to use over and over in command line apps and I have just added a nice little method to get the applications build date using reflection.

I would love to own up to writing the code but honors must go to this post on Coding Horror.

18 September 2008

C# Label transparency

I am writing a small configuration editor for work at the moment and have come to make the initial release for the other guys to test. As the tool could end up in the hands of our partners I thought I would add a decent looking splash screen and about box.

Creating a graphic was the easy part. I left room for a label to be added on the splash window to display the application version. This was an approach I took when working with VB6/VC++ many years ago so I could pass the version info in the page load event. The only trouble is that C# label controls do not support full transparency.

I did a bit of searching and reading of docs. It turns out that turning the .BackColor property to Transparent will only set the back ground colour to the colour of the containing control. Hence if like me you have a picture box and a label it will show the back ground colour of the picture box control, grey (or the default control colour).

Therefore, the following (where pb is a picture box control and l is a label) will do the job. The code should be added to the splash window class.

Private void pb_Paint(object sender, PaintEventArgs e)
{
l.Visible = false;
e.Graphics.DrawString(l.Text, l.Font, new SolidBrush(l.ForeColor), l.Left - pb.Left, l.Top - pb.Top);
}