Option Explicit
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)
Private Sub Combo1_DropDown()
SetDropdownHeight Combo1, ScaleHeight
End Sub
' Adjust height of combobox dropdown part; call in response to DropDown event
Private Sub SetDropdownHeight(cbo As ComboBox, ByVal max_extent As Integer)
' max_extent is the absolute maximum clientY value that the dropdown may extend to
' case 1: nItems <= 8 : do nothing - vb standard behaviour
' case 2: Items will fit in defined max area : resize to fit
' case 3: Items will not fit : resize to defined max height
If cbo.ListCount > 8 Then
Dim max_fit As Integer ' maximum number of items that will fit in maximum extent
Dim item_ht As Integer ' Calculated height of an item in the dropdown
item_ht = ScaleY(cbo.Height, ScaleMode, vbPixels) - 8
max_fit = (max_extent - cbo.Top - cbo.Height) \ ScaleY(item_ht, vbPixels, ScaleMode)
If cbo.ListCount <= max_fit Then
MoveWindow cbo.hwnd, ScaleX(cbo.Left, ScaleMode, vbPixels), _
ScaleY(cbo.Top, ScaleMode, vbPixels), _
ScaleX(cbo.Width, ScaleMode, vbPixels), _
ScaleY(cbo.Height, ScaleMode, vbPixels) + (item_ht * cbo.ListCount) + 2, 0
Else
MoveWindow cbo.hwnd, ScaleX(cbo.Left, ScaleMode, vbPixels), _
ScaleY(cbo.Top, ScaleMode, vbPixels), _
ScaleX(cbo.Width, ScaleMode, vbPixels), _
ScaleY(cbo.Height, ScaleMode, vbPixels) + (item_ht * max_fit) + 2, 0
End If
End If
End Sub
If you need to perform a case sensitive search and/or replace in an SQL 2000 or SQL 2005 database you need to use the correct collation method. In the situation I had today I needed to change some copy throughout a website, all of which is in a string resource table, but I had to be careful to maintian case used, i.e: ‘Shipping’ had to change to ‘Delivery’, but ’shipping’ had to change to ‘delivery’.
Your database may have been set up to use a case-sensitive collation method, or it may not have, or you may not have been involved in setup. I don’t know which collation method is the smartest in the world to use - I’m not a DBA - but here’s how to find out which collation you’re working with.
Execute this query in a query analyser:
select charindex('If the result is 0 you are in a case-sensitive collation mode', 'RESULT') A 0 return result means you’re working with a case-sensitive collation mode. This means you can write your search/replace query (I’ll give an example below) without specifying the collation method you want to use and your query will consider ‘RESULT’ different to ‘result’.
If you DO have to specify a collation method you just have to declare it after the column name you’re interested in. Here’s an example:
update StringResource
set ConfigValue = replace(ConfigValue COLLATE Latin1_General_BIN, 'Shipping', 'Delivery')
from StringResource
where charindex('Shipping', configvalue COLLATE Latin1_General_BIN) > 0
update StringResource
set ConfigValue = replace(ConfigValue COLLATE Latin1_General_BIN, 'shipping', 'delivery')
from StringResource
where charindex('shipping', configvalue COLLATE Latin1_General_BIN) > 0
This query replaces the word ‘Shipping’ with ‘Delivery’ in the ConfigValue column in the StringResource table. There are two seperate statements, one for each case I’m replacing, because I need to specify the casing I’m concerned with explicitly. The important part of the collation type is the _BIN part, which specifies that I want to compare strings as binary data. More information about aspects of collation sorting here. This method may not be the smartest in the world so I would appreciate any comments.


It's easy to get sloppy on the grammar when you're chatting, but the Text Replacement plug-in's autocorrection macros seamlessly correct common typos on-the-fly. If you've got a particular grammar offense that's not included in Text Replacement by default, you can add your own corrections to the list. Wish you had this functionality in every program? Check out
Keep your IM sessions secure without hassle with the
The Autoaccept plug-in allows you to set rules for automatically accepting file transfers from specific users. As I pointed out in the
The Guifications plug-in notifies you of user status and incoming messages with a small pop-up window in the corner of your screen, similar to how Growl works with Adium on the Mac. You can customize the look, location, and what events will trigger a Guification alert so you're only distracted by a Guification pop-up when you really want to be.
Pidgin comes with a built-in History plug-in that automatically inserts your last conversation with the current contact in your new conversation—especially handy if you're rejoining a conversation and want to pick up where you left off (after restarting your computer, for example). If that's enough for your needs, just flip the switch on it and you're set with the default plug-in. If you want more functionality, like the ability to display anywhere from zero to 255 previous conversations or limit chat histories by how long ago they occurred, the non-default Enhanced History plug-in is for you.
If you're terrible at setting your status or remembering to change it, let the MusicTracker plug-in update your status for you. The plug-in sets your status to whatever music you're listening to, works with tons of digital music players from iTunes and Winamp on Windows to Amarok and XMMS on Linux, and exactly what it displays is very customizable.
Pidgin runs on both Windows and Linux using the GTK graphical environment, so theming Pidgin is as easy as using GTK's built-in theming tools. Here's how it works on Windows. 












