Wednesday, July 6, 2011

Set ComboBox dropdown height in Visual Basic 6 (VB6) ComboBox control

Here is a useful piece of code to set the ComboBox dropdown height for VB6 ComboBox control.


Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long

Public Sub SetComboHeight(oComboBox As ComboBox, lNewHeight As Long)
    Dim oldscalemode As Integer
    ' This procedure does not work with frames: you cannot set the ScaleMode to vbPixels, because
    ' the frame does not have a ScaleMode Property.
    ' To get round this, you could set the parent control to be the form while you run this procedure.
    If TypeOf oComboBox.Parent Is Frame Then Exit Sub
    ' Change the ScaleMode on the parent to Pixels.
    oldscalemode = oComboBox.Parent.ScaleMode
    oComboBox.Parent.ScaleMode = vbPixels
    ' Resize the combo box window.
    MoveWindow oComboBox.hwnd, oComboBox.Left, oComboBox.Top, oComboBox.Width, lNewHeight, 1
    ' Replace the old ScaleMode
    oComboBox.Parent.ScaleMode = oldscalemode
End Sub


I've found this code on the web.
I would like to thanks to the original developer :-)

Friday, July 1, 2011

Reblog: +=1, -=1 not atomic operations at VB.net « George Birbilis @zoomicon

This is something that bit me sometime ago: seems +=1 and -=1 aren’t atomic operations at VB.net and other .NET languages (not sure for C++) although modern CPUs have INC and DEC instructions at least for integers (maybe IL – intermediate language [for .NET compilers' target "theoretical" machine spec] – doesn’t define such?)

You have to use the class System.Threading.Interlocked and specifically the Increment and Decrement methods it has...

Patterns for Parallel Programming (free downloadable pdf book by Microsoft) Understanding and Applying Parallel Patterns with the .NET Framework 4 - VB and C#

Here you can find a free downloadable PDF boook (118 pages) from microsoft, that talk about common pattern for parallel programming in .Net 4.0, VB and C#

Download link: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=19222

 

 

 

 

Wednesday, June 22, 2011

Browser benchmark: Firefox 5.0 vs. Chrome 13 vs. Internet Explorer 9 on V8 Benchmark Suite

Firefox 5.0 vs. Chrome 13 vs. Internet Explorer 9

V8 Benchmark Suite - version 6

Results (higher is better):

Chrome 13 beta  -  9669
Firefox 5.0          -  4385
IE 9                     -  2138

Conclusion
Chrome 13 beta win, but Firefox 5.0 isn't bad :-)

(test run on Win7 x64 SP1, CPU Intel i7 860@2.8GHz)

xkcd: Connoisseur

Media_httpimgsxkcdcom_fhsge

That's absolutely true :-)

Friday, June 17, 2011

Reblog: [H]ard|OCP - Microsoft Launches Kinect for Windows SDK Beta

Microsoft Launches Kinect for Windows SDK Beta

You know all those cool videos we post showing people doing neat stuff with the Kinect? Well, now you can make your own thanks to the new Kinect of Windows SDK beta.

News Image

Cool!

Friday, June 10, 2011

Reblog: What is the Best Way to Apply Thermal Compound? | Hardware Secrets

We already explained how the thermal compound (a.k.a. thermal grease or thermal paste) works and a “how-to-apply-it” in our How to Correctly Apply Thermal Grease tutorial. Now, we will try seven different ways of applying it, testing each way, and comparing the cooling performance. Let's see if what we always mention - that less thermal compound is better than more - is true.

Each different method is presented in three pictures, one of the thermal compound applied to the CPU before installing the cooler, one of the CPU after the test with the cooler removed, and one of the base of the cooler after the test.

A nice article with some real test about how to apply thermal compund.

Wednesday, June 8, 2011

Hey! It's IPv6 Day! Test your IPv6 connectivity!

Today, 8 june, is the IPv6 Day, where many major internet society will enable their service on IPv6 connectivity!
Test your IPv6 connectivity here http://ipv6eyechart.ripe.net/ (simple IPv6 test) and here http://test-ipv6.com/ (detailed IPv6 test).
Are you ready to browse the internet in IPv6 only connectivity?

My computer seem to be ready, but my ISP isn't....

I wish you you all a happy IPv6 Day! :-)