Shandy's Blog

Where Andrew Sutton, aka Shandy rants and rambles on as the fancy takes him

This blog hosted by:
http://blogs.vbcity.com      
  Home :: Syndication  :: Login

My name is Andrew Sutton, aka Shandy.

I am currently living and working in the UK within the garment industry as an IT specialist. This blog contains mainly IT related issues.

I was a Microsoft VB MVP for a couple of years (Apr 2004-Mar 2006) and was a vbCityLeader between April 2003 and June 2007.

If you are looking for my Sri Lanka or Morocco experiences check out Shandy's Sri Lanka Blog or Shandy's Morocco Blog.

OctNovember 2004Dec
SMTWTFS
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

Articles

Archives

Topics

Image Galleries

.NET

Blogs I Read

Others

VB.Classic

Sunday, November 21, 2004 #

I spent some time today creating a style sheet I could use for publishing my articles. Although I couldn't manage to utilise a stylesheet file I was able to post the stylesheet between <style> tags to provide the same functionality I would have got from a stylesheet file. Of course, I would have to alter all my posts separately if I wanted to update the styles at a later date so I'll persue the idea of using a stylesheet file when I have time. For now I have an easy formatting method I can at least move on with.

I also utilised Eddie and Hotdog's BlogBlock to provide the button arrangements used on this page. Many thanks to Edward & Robert for publishing this code. Use the buttons immediately below to view the style sheet I am currently using to publish my blog articles and posts.

body {
 font-family: Verdana, Arial, Helvetica, sans-serif;
 background-color: white;
 color: black;
 font: 12px;
}
p.ArticleHeading {
 font: bolder 150%;
} 
p.Author {
 font: lighter smaller;
}
p.SectionHeading {
 font: italic bolder larger;
}
q {
 font: italic;
}
p.VBCode {
 font: smaller "Courier New" Courier monospace;
 border-top: thin solid Gray;
 border-bottom: thin solid Gray;
 padding-top: 1%;
 padding-bottom: 1%;
}
span.VBKeyword {
 color: Blue;
}
p.CSharpCode {
 font: smaller "Courier New" Courier monospace;
 border-top: thin solid Gray;
 border-bottom: thin solid Gray;
 padding-top: 1%;
 padding-bottom: 1%;
}
span.CSharpKeyword {
 color: Blue;
}

div.ButtonsAndCode {
 font: 11px "Courier New" Courier monospace;
 border-top: thin solid Gray;
 border-bottom: thin solid Gray;
 padding-top: 1%;
 padding-bottom: 1%;
}
button {
               font-size: 8pt; 
               width: 100px;
}

I also Shandyfied Eddie and Hotdog's BlogBlock code to utilise pre-defined styles. See the following example for the code I actually used to produce the button code areas.

<DIV class="ButtonsAndCode">
<BUTTON onclick="var vis,sty;vis='';sty=this.nextSibling.nextSibling;sty=sty.nextSibling;
sty=sty.style;vis=sty.display;vis=(vis=='')?'none':(vis=='none')?'':vis;sty.display=vis;vis=(vis=='')?'Hide Code':'Show Code';
this.innerText=vis;">Show Code</BUTTON>
<BUTTON onclick="var vis,sty;vis='';sty=this.nextSibling.nextSibling;sty=sty.style;vis=sty.height;vis=(vis=='')?'8em':(vis=='8em')?'':vis;
sty.height=vis;vis=(vis=='')?'Scroll View':'Full View';this.innerText=vis;">Full View 
<DIV style="display: none; overflow: auto"; height=8em>
<PRE>
What ever text goes here is what gets displayed when you click on Show Code.
</PRE>
</DIV>
</DIV>

Note that to utilise the <style> tags and Eddie and Hotdog's BlogBlock I had to add <html>, <head> and <body> tags to the post, even though the post itself is within <html> and <body> tags. However, it seems to provide the desired effect.

posted @ 6:13 PM

I have published a beginner's article on How To Rename A Windows Form Control which covers how to update any event handlers already coded.
posted @ 5:10 PM

I came across this interesting free white paper, C#/VB .NET Coding Guidelines from Iridium Software. To download it you simply need to register with an email address. Whilst I don't agree with everything in it, e.g.

Remove the Visual Basic reference from your project. Making use of the original Visual Basic functions has been proven to be up to 1000 times slower than the .NET counterparts; you have been warned.

We advise completely the opposite at vbCity as it appears to be FUD and urban legend rather than proven

and

There has been an urban myth in programming academia that short procedures of no more than “a page” (whatever that is) are better. Actual research has shown that this is simply not true. There have been several studies that suggest the exact opposite.

Although I don't dispute the findings of any report I suggest that any findings are generic and that something like this actually depends a lot on the individual developer. For me, procedures much larger than 1 page don't work.

However, what I do like about the document is that it offers guidelines not rules and 95% appears good common sense to me. Steve Sartain has come up with a very readable document that offers comprehensive guidelines for structuring code writing. Most of what he says I shall take on board. Certainly if you find you have an hour or so free you could do worse than read his white paper.

posted @ 11:14 AM