CodeMash v2.0.1.1

by Bill Sempf 16. January 2011 06:05

 

Another CodeMash is in the books, and all kinds of new stuff was in the offing for me this year.  But first I would be remiss if I didn’t thank Jason Gilmore, Brian Prince and especially Jim Holmes (along with the rest of the board) for uncompromising management of simply the best conference on this topic.  Period. Not for the money, not for the constraints of space.  It is simply the best code-centric conference on the planet.

I owe a lot of people a lot of links and information on a lot of topics.

imageFirst and foremost, I was delighted to be asked to speak again, and was pleased to have Matthew Groves join me for a discussion on Monodroid.  We had 100 people join us for a look at how Monodroid came to be and what the future holds.

Then Matt took us for a tour of his excellent Stock Tracker application (shown left), converted from Windows Mobile.  There were a number of good points made all around, and generally a good time was had by all.

The Monodroid documentation contains nearly everything that you need to know to get programming.  The tutorials are the best starting point, and provide the templates for all of the major use cases. Matt’s application is on GitHub – please feel free to get it an mess around.  It’s a good app.  I’ll have BabyTrak up here in a couple of months.

imageThe Locksport openspace was a rousing success.  About 40 people were taught to pick, and about that many more stopped me in the halls and told me that they would like to have been there.  I was frankly astonished by the turnout, and would have brought 5 times as many picks if I would have known about the interest – all 15 of the sets I brought were sold.

For those looking for more information:

The Locksport International site has a lot of good links to publications and whatnot.  Deviant Ollem’s book, Practical Lock Picking, is excellent – he is the guy who wrote the presentation that I gave (twice). The best community is online at Lockpicking101, and they have an IRC channel too.  If you need to order picks, look at LockPickShop – Red does an awesome job.  The 14 piece set is on sale right now and is a great learners set!

imageFinally, if you are in the Columbus area please join us at the Columbus branch of Locksport International.  We have a Meetup group – just go sign up and you’ll get the locations for each meeting.  You can attend for free, but if you want a membership card and to participate in competitions, it’s $20 a year.

And last but not least, I got a ton of comments on the jam band.  Lots of questions too.  Yes, I was a professional musician for many years.  I taught at a lot of area band camps, like Upper Arlington and Teays Valley.  I played in a Dixieland band in London Ohio called the Lower London Street Dixieland Jazz Band and Chamber Music Society for nearly ten years. I haven’t played in quite a while, and I have to say it was a lot of fun.  Hope to do it again next year.

All in all, an awesome conference.  Again, I was a net producer of content rather than a consumer of content, and that’s OK.  I still learned a ton just by chatting with friends old and new, and picked up information about the hip new technologies that the cool kids are using by osmosis.

Hope to see everyone at DevLink!

Tags:

Biz | Personal | C# | Enterprise Architecture | VB

Visual Basic.net For Dummies usage of Northwind database

by Bill Sempf 30. November 2010 10:57

There are a lot of questions about Visual Basic.NET 2005 For Dummies and Visual Basic.NET 2008 For Dummies and the use of Northwind for the samples.  When I wrote the majority of that book in 2004, Northwind was still a common sample database for SQL Server.  When I updated it in 2007, it will still provided as a sample.  Since then, it has been totally replaced by AdventureWorks. Now, finding the sample is hard, and installing it is even harder.

I was going to write a large post on how to do the install, but Pinalkumar Dave did such an awesome job on his blog that I don't have to.  Here is the link:

http://blog.sqlauthority.com/2007/06/15/sql-server-2005-northwind-database-or-adventureworks-database-samples-databases-part-2/

You can get the samples still, from this link:

http://www.microsoft.com/downloads/en/details.aspx?familyid=06616212-0356-46a0-8da2-eebc53a68034&displaylang=en

I hope this helps.  I will be updating the VB book series after I am done with Programming Data, and will change the data samples to use AdventureWorks, or the latest and greatest at that time, if it changes again.

Tags:

Biz | VB

FIX: Classes converted from VS2008 to VS2010 appear as Components

by Bill Sempf 26. August 2010 20:00

 

I don’t remember how this happens (I was told at one point) but sometimes, when you convert a project from VS2008 to VS2010 some classes will appear to be components.  This is annoying, because when you double click to open them, they try to load in the designer, which doesn’t work at all.

To fix this:

  1. Open your Visual Studio Project file in Notepad.  It should be .csproj or .vbproj.  You’ll have to close Visual Studio first.
  2. Locate the reference to the file in question.  It will look like this:
  3. <Compile Include="Connection.cs">
    <SubType>Component</SubType>
    </Compile>
  4. Delete the Component subtype, so the line looks like this:
  5. <Compile Include="Connection.cs" />
  6. Rinse and repeat for each file affected.

Tags:

Biz | C# | VB

VS 2010 Tip: Select error dialog contents

by Bill Sempf 14. June 2010 04:18

 

Back in March when I was testing VS2010’s final versions, I tried to get the contents of a dialog box in order to look up an error.  It’s a small thing, but you can’t copy the contents of dialog boxes any more with the mouse.  I was bummed, so I submitted a Connect ticket:

“It is not possible to select the text in most dialog boxes generated for Visual Studio exceptions. For instance, when attempting to change the network mix in Web Load Tests, the dialog box refers you to a URL at go.microsoft.com for details on administration privileges required. However, it is not possible to select the URL and paste it into a browser.”

As I expected, I was told to go away, they were in RC and weren’t going to add a feature now.  That’s cool.

However, I just got an email from Neelesh on the Load Test team, and he points out that:

“As a workaround you can use "Ctrl_Insert" to copy message box text, paste in notepad and select URL. Kludgy workaround, i agree.”

Kludgy or not, it works great and I’ll use it.

Tags:

C# | VB | Biz

VB6, VB.NET and dynamic typing

by BillSempf 9. November 2009 16:59

A recent reader emailed to wax poignant about VB6, and ask about dynamic typing – among other things – in VB.NET.  although I feel that static typing has a more firmly established place than ever in software development, I commiserated with him in this response:

A lot of people agree with you.  There is even a well-established petition at http://classicvb.org/ that states these and a lot of other problems with VB.NET, and the .NET Framework in general.

However, you have to remember that VB.NET is a language, and VB6 is a program, language and framework all in one.  As I pointed out in Chapter 1, they are designed to do different things.  A lot of the things that you could do in VB6 are considered bad practice now, due to scalability and other issues, although many are coming back into vogue. 

For instance, you point out the Variant issue.  What you are saying here is that VB6 is dynamically typed and VB.NET is strongly typed.  Coding for a strongly typed system is a lot slower than for a dynamically typed system.  You will, however, have a lot fewer errors with a statically typed system because any typing issues will usually be caught at compile time.

I have always found it interesting that many community members belittle VB6 for being a 'hack' out of one side of their mouth, and then extol the speed and ease of Ruby out of the other side of their mouth, never realizing that the dynamic typing system is a common defining characteristic of both 'languages'. 

I should add that dynamic typing is coming back in VB10 (as it is in C# 4.0) with the dynamic language runtime.  Hopefully that will return some of the flexibility to the language that you are looking for.

Tags:

Biz | VB

Defcon Recap

by BillSempf 8. August 2009 18:16

Defcon 17 is in the books, and Gabrielle and I had another fantastic time.  Props go out to all of the Defcon staff.  The Locksport International team and TOOOL put another fantastic lockpicking village together.  Coffee Wars pulled a record turnout of thirty-six brews, and we met some great people there.  (We lost badly.) And thanks to the hard working goons we met.

We arrived on Thursday, but with the new Defcon 101 tracks, we were practically late.  The lines weren’t much worse than usual but there was a badge shortage right away thanks to the fine people at Chinese Customs.  Gabrielle and I ended up with paper badges at first, but Gabrielle social engineered us into two actual badges soon thereafter.

The badge, as usual, is fantastic.  Kingpin did an over-the-top job of building a sleek, simple badge that still has lots of hacking potential and out-of-the-box functionality.  It uses the 32 pin MC56F8002 processor, with a microphone and an RGB LED to produce visual effects from aural input.  Wired Magazine actually published the open source firmware.  I am not a hardware hacker, but I have been working on getting it to produce different visual output based on pitch rather than volume.

I didn’t get his name, but one of the engineering team from Freescale (the company that made the microprocessor on the badge) came to the con.  He just set up shop in the Hardware Hacking Village and helped people program the board.  It was one of the coolest things I have seen at any con.  As some of you probably know, my hardware experience is circa 1979.  He effortlessly moved between helping me with the most basic soldering questions to the most advanced programming questions.  I was blown.  Get me his address, someone.  I want to send him a bottle of Scotch.

It seemed like the traffic flow was worse at first compared to Defcon 15, but it soon leveled out.  Part of the problem was the need to clean out the rooms fully and then count them coming back in due to the fire code.  The marshals were around, and very visible, throughout the con.

There is a lot of talk about the Riv being too small.  I happen to disagree – I think that DT just needs to find a logistics volunteer that will orchestrate the talks in such a way to control the crowds.  I have seen Gabrielle do it.  It is possible.  (You hear that Jeff?  She will work for Absolut.)  The people at the Riv work their collective asses off to make it a good con and you just can’t replace that.  Let’s change the logistics instead.

Oh wait, there was technical content too!  Who knew?

The most significant thing I learned is that for all of the protections for CAS in the .NET Framework, there is a mind blowing flaw.  The framework assemblies are just called by name.  If you replace an assembly, EVERY .NET program on that machine will use the altered DLL to run the program.  Does that mean if you replace the encryption protocol to email the keys to China, that all programs will send that key to China?

Yes.

Discuss.

Props to Erez Metula.

There was a great talk on using iMacro to do screen scraping for AJAX sites, and I plan on getting some new PoCs for that up in the future.  It wasn’t rocket science, but it was a really good implementation of a simple idea that I sure as hell didn’t come with.  I mean, if it was easy, everyone would be doing it, right?  Screen scraping is a massively underused art.  There is a LOT of information out there and the web browser just sucks for really making use of it.

So much net development was done on Metasploit in the last 12 months that they got an entire track dedicated to it.  The biggest piece is undoubtedly the Oracle module, which really puts all of the disparate Oracle attacks into one place for ease in testing.  I can’t recommend its use enough if you are a pen tester or in charge of db security

The civil liberties content was significant compared to 15.  Nearly one whole track for three days was filled with lawyers telling us how not to go to jail when we fly to Italy on vacation with some music of questionable origin on our laptop.  I just popped in and out of these, but every time I did I learned something.

 Did you know that if you are asked to give up your password in the states you can say “come back with a warrant” but if you are flying overseas, they can just take the machine without your permission, copy the whole hard drive, and say “Thanks for the warez, d00d.”  Lesson learned?  Carry an empty laptop overseas and download your data set from a secure channel once you get there.   When done, upload results and clear the machine again.  Microsoft doesn’t even LET you carry a machine overseas.

Speaking of privacy (weren’t we, really?) social networking was a huge topic this year.  Tom Eston and Kevin Johnson gave a great talk on some proof of concept work they did on social networks and trust.  For instance, set up a parody account of a ‘B’ celebrity, and gain trust of followers.  Then send out a link for a fun quiz with an XSS attack.  Gain twitter cookie, get password, rinse and repeat.  Social Butterfly is another of their tools, which manages the creation of apps in social networking sites like Facebook.  It collects user accounts to be used for research purposes.  Check it out.  It’s not just that picture of the Christmas party last year that will get you in trouble on Facebook.

Locksport village was very informative, very well attended, and very well stocked.  I picked up some new equipment and finally met both Schuler Towne and Doug Farre in the flesh.  Doug and I are going to make some moves toward getting the Locksport International organization a little more, well, organized, and get things up and running there. 

Gringo Warrior was a hoot.  I supplied the live guard with a cigar (which he really needed!) and watched.  Deviant had a whole boatload full of people, and I hadn’t practiced enough, so I didn’t do it this year.  Maybe next year.  The ah-ha moment for that was watching a very accomplished picker run the whole gamut in three minutes, and then spend ANOTHER three minutes trying to open the car door.  After that, Deviant stood by the auto locks and yelled “Everyone look!!”  Took out his auto jigglers.  “Easy lock,” pop.  “Medium lock’” pop.  “Hard lock,” pop.  “GET some jigglers people!  They aren’t that expensive!”  I got some jigglers.

My Defcon moment had to be standing in the elevator lobby waiting for a ride down from my floor, when thmping bass – LOUD thumping bass – became clearly audible.  I thought “that’s one hell of a boom box.”  Wait.  Aren’t those lights?

The door opens, and there is a full mobile DJ station in the elevator.  I kid you not.  There was a mini-rave going on right there in the elevator with a DJ and dancing babes and the obligatory big white guy who can’t dance just bobbing his head and looking cool.  It had to have been the coolest thing I have ever seen in an elevator, bar none.

Can’t wait for next year, folks.  This one was fantastic.  Till then, see you at PhreakNIC!

Tags:

Biz | C# | Cloud | Enterprise Architecture | VB | Personal | Locksport | Ninjutsu

My Visual Studio 2010 presentation for ICC

by Bill Sempf 5. May 2009 12:03

Just finished up a presentation on Visual Studio 2010 for ICC's MS Dev special interest group.  A good time was had by all.  I used the card deck that is in the Training Kit, and added a few salient slides.  We had a lot of conversation about Linq, WPF and the lifecycle integration.

My slide deck can be downloaded here, and I also wanted to post a few links that I mentioned in the talk.


I hope to get some comments back - feel free to email me, especially if they are bad.  (heh)  Thanks to all for attending!

Tags: ,

Biz | C# | VB

Live blogging a XAML project with CodePlex - handling failure

by Bill Sempf 1. March 2009 11:01

I bet you all think that I mean failing at writing  the game, didn't ya?  Hmm?  Ha!  Not so fast my friend, I mean handling the last requirement in the project - failing the press the correct letter before the letterbox hits the bottom of the screen.

So what I want to do is check on timer click of the letter has hit the bottom, and if it has then fire off a new message (Oh no instead of Wow) and get a net letter at the top,  Should be good enough for a three year old, I figure.  As I get better in XAML I can make more features, right?

To start off I will modify the ShowWow so that it accepts a TextBlock and renders its transform no matter what it is.  I changed the name of the function to ShowMessage and used the VB refactoring feature to change all references.  Then I altered the signature to accept a textblock as a parameter, and used that object in the code instead of WowTextblock.  Finally, I changed the calling function so that it passes un WowTextblock.  Sounds like a lot, but it just took a second.  ShowMessage now looks like this:

Public Sub ShowMessage(ByVal blockToTransform As TextBlock)
    'Make an animation for the scale
    Dim blockAnimation As New DoubleAnimation(0, 100, New Duration(New TimeSpan(0, 0, 3)))
    'Make another for the opacity
    Dim blockOpacity As New DoubleAnimation(1.0, 0.0, New Duration(New TimeSpan(0, 0, 3)))
    'Go grab the ScaleTransformation from the XAML and se tthe properties
    Dim blockTransform As ScaleTransform = DirectCast(blockToTransform.RenderTransform, ScaleTransform)
    blockTransform.CenterX = 11
    blockTransform.CenterY = 7
    blockTransform.ScaleX = 1
    blockTransform.ScaleY = 1
    'Then run all of the animations
    blockTransform.BeginAnimation(ScaleTransform.ScaleXProperty, blockAnimation)
    blockTransform.BeginAnimation(ScaleTransform.ScaleYProperty, blockAnimation)
    blockToTransform.BeginAnimation(TextBlock.OpacityProperty, blockOpacity)
End Sub


Alright, now I need to add a XAML element that has the Oh No! text in it.  I think I'll make it red.  I just copied the Wow! textblock and edited it.

<TextBlock x:Name="ohNoTextblock" Opacity="0" Foreground="Red" HorizontalAlignment="Center" VerticalAlignment="Center" Text="Oh no!" Visibility="visible">
    <TextBlock.RenderTransform>
        <ScaleTransform></ScaleTransform>
    </TextBlock.RenderTransform>
</TextBlock>


So now clockCheck looks like this:

Private Sub ClockCheck() Handles gameClock.Tick
    letterBoxTop = letterBoxTop + 10
    letterBox.Margin = New Thickness(letterBoxLeft, letterBoxTop, 0, 0)
    'Check to see if it is at the bottom
    Dim bottom As Double = gameBoard.Height
    If letterBoxTop + letterBox.Height > bottom Then
        'It has hit the bottom.  
        gameClock.Stop()
        scoreCount = scoreCount - 1
        'Fire the Oh No message
        ohNoTextblock.Opacity = 100
        ShowMessage(ohNoTextblock)
        'Restart the letter
        SetupLetterBox()
        gameClock.Start()
    End If
End Sub


And there we are!  Kid tested, mother approved too.  I'll post a video of Adam playing it this weekend, when I do my post about further enhancements.  Also, I will check in the changes to CodePlex right now before I forget.

To create a release in CodePlex, I just had to go to the releases tab and Add a New Release.  That gives me a really nice little mini-wiki for the release, and an upload facility for the binary.  I made a few notes and loaded it up!  CodePlex is a really nice, simple facility for opensource work - better than SourceForge for simple projects.  I like it a lot.

I hope this little series has been helpful to everyone - it sure has for me.  I think that XAML is likely the future of Microsoft UI programming, so it behooves us all to get our feet wet as soon as we can, to make the curve less steep when our projects make the move.  Please leave any thoughts in the comments.

Tags:

Biz | VB

Live blogging a XAML project with CodePlex - Now with WPF

by Bill Sempf 28. February 2009 10:59

OK, we have th game basics, we have enforced the game rules, now we need to make it playable.  In order to do this (according to the original requirements) we need to

  1. Add a little pizzaz to the notifications
  2. Handle it when the player looses a letter

So I found that in order to proceed with this project, I needed to define a few terms.

  • XAML - it's basically HTML.
  • WPF - It's ASP.NET, or Cold Fusion, or JSP.  Control that render XAML, like the ASP.NET controls render HTML.

So where does this leave us?  A whole, totally new library to learn, after having already learned HTML since 1992 when it had twelve tags.  Oh, and you windows programmers?  You too.  This replaces EVERYTHING - Windows "ActiveX" and web.  It's global!  Yay.  Replaces Flash even - WPF and XAML run Silverlight.  Rah.  I can't even hide my excitement.

So why am I upset?  Well, I like HTML.  It does what I need.  But I understand that it doesn't fill 100% of what people want, and XAML with WPF probably will.  Problem is when you make a tool that meets everyone's needs, it becomes unusable.  As that say the docs are 'tl;dr;: 'too long; didn't read'.  There are hundreds of options - in HTML there are a few dozen.  Some say that constrains creativity, I think it enhances it.  To each their own.

Polymorphic animation.

Anyway, it's a technology that the biggest software company in the world has embarrassed so I should learn it right?  Right.  There are at least two ways to put text in the viewable area - the letterBox, which we are using for the Game Piece, and the textblock.  The TextBlock is what is needed for the Wow! animation.

One of the nice things about XAML is that it is polymorphic.  Polymorphic is the property of being able to be context sensitive.  If you have a fruit class, and there is a Fruit.Peel method, a polymorphic Peel method will know that you take the skin from a banana, take the seeds out of a pomegranate and don't bother with a grape unless you are making pie.  (No really.  My stepmom just made a grape pie last month.  It was yummy.)

I am pontificating and this is supposed to be a liveblog of a project.  Let it be said that you can apply an animation to an object, and they are truly polymorphic.  Therefore, we have a textblock, and we want to apply two animations to it.  The animations will automagically treat the textblock properly, thus showing us their polymorphic nature.

Enough of that

I want a flying 'Wow'.  To do this, I need to animate two properties: the scale of the block, and the opacity of the text.

There are two ways to implement an animation in WPF.  You can use a storyboard in XAML, which is more of a Microsoft Expression thing to do, or you can apply the methods in code, which is what I want to do.  This is a VB blog, after all.

To animate the scale, I have to add an empty ScaleTransform object to the TextBlock.

<TextBlock x:Name="wowTextblock" Opacity="0" Foreground="Green" HorizontalAlignment="Center" VerticalAlignment="Center" Text="Wow!" Visibility="visible">
    <TextBlock.RenderTransform>
        <ScaleTransform></ScaleTransform>
    </TextBlock.RenderTransform>
</TextBlock>


This isn't necessary with the Opacity animation because the Opacity is already a property of the TextBlock.  I know that Width and Height are too, but scaling them isn't.  I suppose I can get behind that.  Anyway.

To animate the block, I am going to make two DoubleAnimation objects, and then BeginAnimation them one after another.  The Opacity I can directly apply, but the Scale I have to go get from the XAML and then set a few properties for.  I packed the whole thing into a subroutine I called ShowWow.  I will replace the old MessageBox.Show with a call to the new ShowWow method.  Here is the code:

    Public Sub ShowWow()
        'Make an animation for the scale
        Dim wowAnimation As New DoubleAnimation(0, 100, New Duration(New TimeSpan(0, 0, 3)))
        'Make another for the opacity
        Dim wowOpacity As New DoubleAnimation(1.0, 0.0, New Duration(New TimeSpan(0, 0, 3)))
        'Go grab the ScaleTransformation from the XAML and se tthe properties
        Dim wowTransform As ScaleTransform = DirectCast(wowTextblock.RenderTransform, ScaleTransform)
        wowTransform.CenterX = 11
        wowTransform.CenterY = 7
        wowTransform.ScaleX = 1
        wowTransform.ScaleY = 1
        'Then run all of the animations
        wowTransform.BeginAnimation(ScaleTransform.ScaleXProperty, wowAnimation)
        wowTransform.BeginAnimation(ScaleTransform.ScaleYProperty, wowAnimation)
        wowTextblock.BeginAnimation(TextBlock.OpacityProperty, wowOpacity)
    End Sub

Of course, you can download the whole thing from the codeplex site for the project.  Next time, we'll handle missed letters, and then call it a project.  Have fun!  I hope this is being some help to those working in WPF.

Tags:

Biz | VB

Live blogging a XAML project with CodePlex, Part Duex

by Bill Sempf 22. February 2009 10:57

And we are back at the Letters Are Falling project, which has it's own Codeplex URL now ... heh.  If you remember from the last post, we need to

  1. Randomize the letter.
  2. Randomize the start position right to left.
  3. Make it more fun when you win.
  4. Handle it when you lose.

I am going to start with the first two.  For now, I am going to keep this pretty declaritive, and try and use the WPF objects 'correctly' later once I get the bugs worked out of the logic.

Let's add two functions: one for the left randomization and one for the letter randomization.  The left randomization needs to set the left margin anywhere from zero to the width of the window minus the width of the letterBox.  The letter randomization needs to pick from a selection of letters, which we will later make configurable.

Now, certain other things have to happen to make this a game.  It has to restart when you get the right letter, keep score, things I forgot in the original requirements.  In order to do this, I have to set up the game to reset the letterbox, and not have all of the code in the form load event.  To do this, I have built a new function to set up the letterbox, which calls the two new randomization functions.  Then I can change my keypress event to make some gametime decisions, including a Quit function.

The VB file now looks like this:

   1:  Class gameBoard
   2:      Public WithEvents gameClock As New DispatcherTimer
   3:      Private letterBoxTop As Double = 0
   4:      Private letterBoxLeft As Double = 0
   5:      Private scoreCount As Integer = 0
   6:      Private Sub gameBoard_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
   7:          SetupLetterBox()
   8:          gameClock.Interval = New TimeSpan(0, 0, 1)
   9:          gameClock.Start()
  10:      End Sub
  11:      Private Sub SetupLetterBox()
  12:          letterBoxLeft = GetLeftMargin()
  13:          letterBoxTop = 0 - letterBox.Height
  14:          letterBox.Margin = New Thickness(letterBoxLeft, letterBoxTop, 0, 0)
  15:          Dim currentLetter As String = GetLetter()
  16:          letterBox.Content = currentLetter
  17:      End Sub
  18:      Private Sub LetterPress(ByVal sender As System.Object, ByVal e As System.Windows.Input.KeyEventArgs) Handles MyBase.KeyDown
  19:          If e.Key.ToString.ToUpper = letterBox.Content.ToString.ToUpper Then
  20:              gameClock.Stop()
  21:              scoreCount = scoreCount + 1
  22:              MessageBox.Show(String.Format("You got it!!{0}Your score is {1}!!", vbCrLf, scoreCount))
  23:              SetupLetterBox()
  24:              gameClock.Start()
  25:          ElseIf e.Key = Key.Escape Then
  26:              MessageBox.Show(String.Format("Goodbye!{0}Your score is {1}.", vbCrLf, scoreCount))
  27:              MyBase.Close()
  28:          End If
  29:      End Sub
  30:      Private Sub ClockCheck() Handles gameClock.Tick
  31:          letterBoxTop = letterBoxTop + 10
  32:          letterBox.Margin = New Thickness(letterBoxLeft, letterBoxTop, 0, 0)
  33:      End Sub
  34:      Private Function GetLeftMargin() As Integer
  35:          Dim result As Integer = 0
  36:          result = (New Random().Next) Mod CInt(gameBoard.Width - letterBox.Width)
  37:          Return result
  38:      End Function
  39:      Private Function GetLetter() As String
  40:          Dim result As String
  41:          Dim lettersList As String() = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
  42:          Dim listIndex As Integer = (New Random().Next) Mod lettersList.Length
  43:          result = lettersList(listIndex).ToString
  44:          Return result
  45:      End Function
  46:  End Class

In the next edition of Live Blogging a XAML project, we will get into a little more of the XAML itself, including getting rid of the messagebox, and adding a little pizzaz!  Until next time...

Tags:

Biz | VB

Husband. Father. Pentester. Secure software composer. Brewer. Lockpicker. Ninja. Insurrectionist. Lumberjack. All words that have been used to describe me recently. I help people write more secure software.

Find me on Mastodon

profile for Bill Sempf on Stack Exchange, a network of free, community-driven Q&A sites

MonthList

Mastodon