I'm just a kind of in awe. Just popping onto a site like DaniWeb, you seem to forget that there might have actually been some hard work involved, tears, frustration and all host of mixed emotions. You forget that Dani isn't just a binary baby born from the loins of a floppy drive but actually started out with an idea, a pretty hairy design and then worked her ass off, no doubt with the support of friends and the community to mature a grow the site to what it is today.

It's been a massive eye opener for myself, just a quick snapshot of Dani's work the historic screen dumps of DaniWeb has completely al;tered my perspective on a couple of things. 1. What can really be achieved through hard work and actually giving a shit about what you are doing, and 2. The individuals behind sites like this aren't just fat cats with dollar signs in their eyes, their real people, with real dreams, and real goals.

I keep talking about Dani in the third person, I know you're reading this Dani, I'm afraid I just don't know how to wriute this without talking about you and to you at the same time.

Regardless, I just want to say I'm respectfully proud of you, and what you've done, and I'm infinatly grateful to you for providing us with this pretty kick ass service.

...And no I'm not forgetting all the Mods, Admins and the community it's self, every one ...

commented: Thanks so much! +0

Awwww looookkkk how cute it was... OMG what an incredible journey




[Whispers] I hope he's making a demo which physically moves the mouse pointer then clicks the button, which doesn't render my answering only the first half of the question entirely pointless [/Whispers]

Oh No, not another LockBits demo. Well hopefully this demo may also give you a little in site into actually playing with, and calculating some simple effects as well as understanding the advantages of LockBits as apposed to GetPixel and SetPixel.

A Useful Note.

It is important to note that using LockBits is only effective beyond a certain point. Bench tests show that if you manipulate below roughly 60 to 70 pixels in one go, you are in fact better off using GetPixel and SetPixel. Why? Well basically the time allowed for locking bits and unlocking bits, as well as copying all the byte information needs to be considered when making these calculations. Much below 60 or 70 pixels, this time taken exceeds the time taken to simply use Get or Set Pixel.

This can be explained in more detail Here

So What Do We Have Here Then?

  1. Wrapping up Lockbits and associated methods into a more manageble class.
  2. Applying Filter effects to your images.
  3. Playing with the Alpha Channel.
  4. Mimicing Opacity.
  5. Overlaying Images (Layering).

Below you can see the interface which will allow you to manipulate the images, quickly in real time:

** The left hand image, and sliders will allow you to manipulate the saturation of each colour channel in the image, essentially removing a colour from an image.

** The center image shows the left image combined with the right hand image. This image doesnt relay ...

commented: Nice tutorial +15

=======Download The Full Solution Below========

This will be my last VB.Net soure as I've made the move to C#. For a recent job application I was given the technical test to create a horse race simulator which would calculate the odds of a runner winning a race of up to 16 runners, then ensure the runners were within a 2% winning margin of there expected win percentage after 1,000,000 races. I got the results between 0.10% and 0.02% but never got offered the position as my solution was "Beyond Requirements".


This solution is host to ll sorts of goodies including multithreading, basic user controls etc... further more, if you bet on the horses this may be great for you.


=======Download The Full Solution Below========

Bugger. That's beyond my knowledge I'm afraid. Maybe you could post that response in web development and ask about security within iFrames. I think the VB side is ok.

Ok, this is going to hit every <a> tag in the iframe with invoke onclick, but give it a shot

 Dim theElementCollection3 As Windows.Forms.HtmlElementCollection

 'This line now includes access to the iFrame document.
 theElementCollection3 = WebBrowser1.Document.Window.Frames(0).Document.GetElementsByTagName("a")

 For Each Element As HtmlElement In theElementCollection3

if there's more than one frame try changing the Frames(0) to another index. if the index is wrong you will get an error.

I got this to work on a quick demo I made here.


example2.html has an iframe whose source is sameURL/example.html

If this is your own HTML source you can give the <a> tag an id. in this case "Test" then use the following code.

Dim theElementCollection3 As Windows.Forms.HtmlElement

theElementCollection3 = WebBrowser1.Document.GetElementById("Test")


The <a> tag looks like this

<a id="Test" href="javascript:void(0)" onClick="removeOverlayHTML()">
<img style="position:absolute;top:97px;left:290px;border:0;z-index:101;width:10px;height:10px" src="http://www.castup.tv/images/close_button.png" alt="x"/></a>

I'm not 100% but wouldn't you need to invoke the "onClick" member?

Hi guys,

I've just read this months Digest and want to offer my repects to Ancient Dragon, Melvin Stober. A sad loss to the community, and indeed to those who knew him personally.

Much love to his family.
See you on the other side Bro.

I'm really confused by this, by Short do you mean sort, and if you mean sort, can't you just do this

Dim iVals As Integer() = {1, 9, 3, 10, 6, 2, 8, 5, 7, 4}

If you wanted to reverse the sort order

Public Class ReverseComparer : Implements IComparer
    Function Compare(x As Object, y As Object) As Integer _
            Implements IComparer.Compare
        Return New CaseInsensitiveComparer().Compare(y, x)
    End Function
End Class

'Button Click Event

Dim RC As New ReverseComparer

Dim iVals As Integer() = {1, 9, 3, 6, 2, 10, 15}
Array.Sort(iVals, RC)

Display the results

For Each Val As Integer In iVals

If you're going to point out the difference between VB6 and VB.Net, it may be useful to provide some useful methods provided by .Net. This simple function using Date,Time and TimeSpan will return the hours worked and minutes in 1\10 intervals.

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Console.WriteLine(CalculateDailyHours("29/10/2014 17:00", "30/10/2014 03:12"))

    End Sub

    'Make the returned value a double so it can easily be used for future calculations
    Private Function CalculateDailyHours(StartValue As String, EndValue As String) As Double

        Dim StartTime As DateTime = BuildDateTime(StartValue)
        Dim EndTime As DateTime = BuildDateTime(EndValue)

        Dim Diff As TimeSpan = EndTime - StartTime

        'Get The Hour Difference and The Minute Difference in intervals of 10%
        Return Diff.Hours & "." & CInt((10 / 60) * Diff.Minutes)

    End Function

    Private Function BuildDateTime(DTValue As String) As DateTime

        Dim vDate As Date = DTValue

        Return New DateTime(vDate.Year, vDate.Month, vDate.Day, vDate.Hour, vDate.Minute, 0)

    End Function

The returned value is 10.2 as a double

commented: Good! +15

After trying to manipulate PNG files and failing miserably discovering that the standard GDI doesn't provide support for any PNG parameters decided to provide some basic image manipulation functions built into .Net that I came across on my investigations.

1. Adjust Image Quality
2. Flip Image Horizontally
3. Flip Image Vertically
4. Rotate Image (90 Degree Step)

This Source Uses 4 buttons, A HScrollBar and A PictureBox.

I've just gone through all this myself. It was great. Here were my steps for my particular approach. (Links Below) Note: This was just my recent research into MySQL, there are other alternatives.

First there are a few DBMS or RDBMS <--- Learned that too. MySQL Workbench, MS SQL Server, Oracle etc

I chose to Use MySQL, so I downloaded SQL Server which runs nicely as a service in the background. I also have MySQL Server running on my server (For remote testing) and installed MySQL Workbench for additional testing and development.

I then downloaded and installed SQL Connector for VB.Net, which lets me easily connect to MySQL databases.

After that I bought a SQL book which gave me all the commands I need to play with.

I then checked out Microsoft's Virtual Accadamy on database fundamentals

I'm Having great fun.

So in this order i did the following

  1. Watched and learned the fundamentals of databases on MSVA Click Here These guys are using MS SQL Server (T-SQL etc) which has some slight SQL variations

  2. Bought this book for SQL commands (Superb by the way) Click Here

  3. I then got my hannds on MySQL Server This page gives you links to MySQL, MySQL Workbench, and the VB.Net Connectors Click Here

It took a couple of days to figure everything out, but now it's all fine and dandy.

Note: if you don't want to have to install the MySQL Server then you need to look into ...

I love this stuff, brings back the good old days. It's not even a "Complete Game" still I spent a good five minutes pinging balls all over the place.

commented: awesome..10x for your comment +4

is your picturebox inside a panel?

NOTE: The games GUI is not fully implemented, so changing it's image and difficulty is done manually in the Button.Click Event

NOTE: Whether you download the VS2013 source file or copy and paste the code, you need to download, and extract the two image files to the project's "Bin\Debug" directory.

If you copy and paste the source ensure your form has the following controls:

Button (Button1)
PictureBox (Name:pbGameBoard, Width:792, Height:792)


This is a fun example using graphics. It is a representation of the classic tile slide game, where you slide the tiles around to make the picture. This version is a little different. There are Tiles and Sub Tiles. The Tile Grid is 9 x 9. Each Tile has a 9 x 9 Sub Tile Grid.

If you set the game to Easy then only the main Tiles are scrambled. If it is set to Medium then not only are the Tiles scrambled but so are their sub tiles.

Instead of sliding the tiles around, this game is actually switching tiles\subtiles with the adjacent tile\subtile. Subtiles cannot be switched with subtiles from a different tile.


To Start A New Game:
Click your button

To Move Tiles:
Select the center SubTile of The Tile you want to move. The SubTile will be selected in Green. Move the mouse to the center SubTile of an adjacent tile and the cursor will turn yellow. If you click now, the two Tiles will be switched. ...

commented: Very nice post! +9

It's greate site Dani, I guess I just forgot how to play nice with others.

Oh pant's, you up vote and it becomes featured? daaaaaaaaaaaaaang it.

"note to self... Keep out of it man"

@Santanu Das.

I have been on DaniWeb just over two weeks now, and what a roller coaster it has been. Honestly I was seconds away from giving a good ole down vote to this thread.... "oooo scary", but every day things get more and more clear. Though I hope I'm miss-understanding what Mr.M is saying and will not get too involved in the initial post, there is an element that can be extracted... Santanu Das... you help everybody and any body, but if we're going to teach people, make sure we provide a solution, well commented and documented that can teach them. If they decide to copy, paste and run, that's up to them, but if you've provided a solid base to learn from, comments, structure etc, I don't think anybody will be upset if help is provided.

I've never studied a day of any I.T. subject in my life. When I first saw MSDN after half an hour I was crying in the corner, rocking backward and forward. I've come a long way and can now use MSDN quite happily, but it was a combination of factors that got me to where I am 1. people prepared to provide good learning material and 2. My decision, once I'd got the code to learn and understand it.

just to make sure I'm not getting the wrong end of the stick here. I'd like you to play part in the following scenario.

Post From :TheNoobestNoobEver
Increase Rep:0
Decrease Rep:0

Question: I'm brand new to VB.Net, and for my school project I have been asked to run a counter from 1 to 10 and show the increments in a label.

Answer 1:

    For X As Integer = 1 to 10

Answer 2:

Start by placing a button and a label onto your form. In the Button's click event paste the following code.

    'You would be best off using a For-Next Loop
    'The Loops can either iterate through a collection
    'of objects or increment values.

    'This loop is going to increment the value of X
    'from 1 to 10. Each time we hit Next the loop 
    'goes back to the beginning and increments X
    'by 1 until it reaches 10, at which point the loop
    'is exited

    For X As Integer = 1 to 10
        'Here you can see your labels text property is set to
        'the value of X
        'BEcause this loop will run super fast, let's slow
        'it down so we can see the reults
        Me.Refresh()'Refresh the form and it's objects
        Threading.Thread.Sleep(100)'Pause the UI thread 1\10 of a second

Answer 3:

Have you tried MSDN Click Here

Just go ahead and answer which response you would provide to this day one, potential software engineer.

Have you seen this?

Click Here

That's great to hear. My biggest piece of advice for you is remeber you have an undo button, many many undos. Don't be afraid to change and play with code and monitor the results... if you brake it, use undo.

I do get something from helping. Not only do I learn next time to be much clearer and accurate in my responses, I get satisfaction in knowing I've helped someone. Simple as that.

commented: Right on. +12

Yes dim will work.

OK. you need to remove the connection between the timer and the actual clock. try this.

Every time The ClockTick is called the routine is adding one minute onto the clock time.

The timer is only the frequency of "How Often Is The ClockTick Routine Called"

changing the timer interval only increases or decreases time between calls to the ClockTick routine.

The ClockTick routine counts in minutes not seconds.


If we set the Timers interval to 10, every 10 milliseconds, one minute will be added to the clock.

If we set the timer interval to 1000, every second, one minute will be added to the clock.

If you wanted the clock to represent a realtime scenario you would set the Timer interval to 60000 (60 seconds). This means every minute the ClockTick routine is called and the clock minute is incremented by 1.


error is: Object reference not set to an instance of an object.

Apologies, delete this line of code.

'This Value Is In MilliSeconds So If You Wanted
'1 Tick Every Second You Would Set This To 1000
ClockTimer.Interval = 10

If I make it to count seconds, result would be same, but it will be needed longer time to finish or?

Again correct. This is the delay mechanism between counts for method 2 used purely to slow the incrementing down so you can see what is happening. In Method 1 the delay mechanism is the Threading.Thread.Sleep(10) where 10 is also milliseconds. If you remove this from method 1 the routine would complete before you could blink

OK, here's the basic solution that you wanted. I have included 2 Methods. Each method provides the same results, but one is timed using a Timer (Method 2) and the other is a simple Do - Loop (Method 1).

I've included the Do-Loop so you have all the code you need in one place, however it will lock up your form.

To copy and paste this code directly you need to add a label and two buttons to your form.

Public Class Form1

    '#####################################Solution Objects
    'The Timer Object That Will Provide
    'You With A Tick
    Private ClockTimer As Timer

    'Your Clock Object That will hold the time
    Private Clock As DateTime

    'The End Time
    Private EndTime As DateTime

    'Hands Over Counter
    Private HandsOverCount As Int16
    '##################################END SOLUTION OBJECTS

    '###################THIS CODE NOT NEEDED FOR METHOD 1
    Private Sub Form1_Load(sender As Object, e As EventArgs) _
    Handles MyBase.Load

        'Initiate A New Timer
        ClockTimer = New Timer

        'Add A Handler For The Tick Event
        'Every Time The Timer Ticks It Calls the "ClockTick" Routine
        AddHandler ClockTimer.Tick, AddressOf ClockTick

    End Sub
    '###################END THIS CODE NOT NEEDED FOR METHOD 1

    '###################################METHOD 1
    'Start The Simple Do-Loop Example
    Private Sub Button2_Click(sender As Object, e As EventArgs) _
    Handles Button2.Click


    End Sub

    'This is a standalone version in a loop. It will give you
    'the same results as the example above but all the elements you need
    'are in one place. Rmember though, running this directly will lock
    'up your windows form until completion.
    Private Sub ...

oops, wrong thread

Ok. Though thinking about it there is only 11. 12:00 is the start point 11:59 is the end point there are 60 minutes in an hour but they go from 0 to 59. 0 can't be the start and end of the same hour otherwise therd be 61 minutes in an hour.

I'll have the solution for yoy in a few hours.

Sorry its 12 if you count the the stary and end podition. Its only 11 if you dont count the start position.

Ignore previous post about it 13

Ok so starting at 12 isn't being counted as hands over each other... i suppose if you start at 12 and end at 12 technically they're over each other 13 times. Im sorry but 11 just isnt right, you'd have to start at 12:01 and end at 11:59 for 11 counts.