TomGee.us

Detect Double Right Mouse Click (VB.NET)

by on May.07, 2012, under VB.NET

Simple Black Ops 2 countdown timer that’s triggered/dipslayed when the user double right-clicks the status bar in an application.  #easteregg


Private Sub StatusStrip1_MouseDoubleClick(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles StatusStrip1.MouseDoubleClick
If e.Button = Windows.Forms.MouseButtons.Right Then
Dim dt_BO2Launch As Date = "11/13/2012 00:00:00"
Dim tspan As TimeSpan = dt_BO2Launch.Subtract(Now)
MessageBox.Show(tspan.Days & ":" & tspan.Hours & ":" & tspan.Minutes & ":" & tspan.Seconds & vbCrLf & "DD:HH:MM:SS", "Time until Black Ops 2 Launch!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
End If
End Sub
Share
Leave a Comment :, , , , , , , , , , , , , , , , , , , , more...

Mac – How to speed up or slow down a video in iMovie

by on Apr.23, 2012, under iMovie, Uncategorized

This tutorial was done in iMovie ’11, but the same is true in iMovie ’09.

http://www.youtube.com/watch?v=KE26SY4LDh8

Share
Leave a Comment :, , , , , , , , , , , , , , , more...

Chef Boy-R-Gee’s Mac & Cheese

by on Dec.23, 2011, under Entree

Ingredients:
  • 1 1/2 pounds (or so) of cooked elbow macaroni
  • 8-10 ounces (total) of Sharp Cheese and Extra Sharp Cheese
  • 4 Eggs beaten in 1.5 cups milk

Cooking:

  • Mix all ingredients in a large casserole dish and cover almost all the noodles with the egg/milk mixture
  • Add salt and pepper
  • Bake at 350 for 45 minutes (give or take)

Topping (optional):

  • 2 tablespoons unsalted butter
  • 2 cups Panko bread crumbs
  • 1 cups extra sharp cheese

Melt butter and stir together with bread crumbs and cheese until combined well.

Share
Leave a Comment :, , , , , , , , , , , , , more...

Enable/Disable Integrated Windows Authentication (VBScript)

by on Dec.16, 2011, under Scripts

Option Explicit

'-----------------------------------------------------------------------
'	Enable/Disable Windows Integrated Authentication setting in IE8
'	Developer:	Tom Gee
'	Date:		12.16.2011
'-----------------------------------------------------------------------

Dim WSHShell, RegKey
Dim strInput, strCurrValue, strEnabled, strDisabled, strNewValue

strEnabled = "enabled"
strDisabled = "disabled"

set WSHShell = CreateObject("WScript.Shell")
RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\EnableNegotiate"

ReadRegistry

strInput = MsgBox("Integrated Windows Authentication is currently " & strCurrValue & "." & vbcrlf & vbcrlf & "Do you want to change this value?",vbYesNo,"Change Current Value?")

If strInput = vbYes Then
	If strCurrValue = strEnabled Then
		strNewValue = "0"
	Else
		strNewValue = "1"
	End If

	WSHShell.RegWrite RegKey, strNewValue, "REG_DWORD"

	ReadRegistry

	strInput = MsgBox("Integrated Windows Authentication has now been set to " & strCurrValue & ".")
End If

Sub ReadRegistry()
	strCurrValue = WSHShell.RegRead(RegKey)

	If strCurrValue = "1" Then
		strCurrValue = strEnabled
	Else
		strCurrValue = strDisabled
	End If
End Sub
Share
Leave a Comment :, , , , , , , , , , , , , , , more...

Increase/Decrease Textbox Font Size Programatically (VB.NET)

by on Oct.28, 2011, under VB.NET

Private Sub frm_Main_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        ' Ctrl + + = increase the SQL size
        If e.Control And e.KeyCode = Keys.Add Then
            Using f As Font = TextBox1.Font
                TextBox1.Font = New Font(f.FontFamily, f.Size + 1, f.Style)
            End Using
            Exit Sub
        End If

        ' Ctrl + - = decrease the SQL size
        If e.Control And e.KeyCode = Keys.Subtract Then
            Using f As Font = TextBox1.Font
                TextBox1.Font = New Font(f.FontFamily, f.Size - 1, f.Style)
            End Using
            Exit Sub
        End If
End Sub
Share
Leave a Comment :, , , , , , , , , , , , , , , , , , , more...

Capture when Ctrl+Enter keys are pressed at the same time (VB.NET)

by on Oct.25, 2011, under VB.NET

Make sure your Form’s KeyPreview property is set to True.

    Private Sub frm_Main_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        If e.Control And e.KeyCode = Keys.Enter Then
            ' Do something
        End If
    End Sub

You can also capture when the Alt+Enter keys are pressed at the same time with the following:

    Private Sub frm_Main_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        If e.Alt And e.KeyCode = Keys.Enter Then
            ' Do something
        End If
    End Sub
Share
Leave a Comment :, , , , , , , , , , , , , , , , , , more...

Populate a DataGridView with SqlDataReader

by on Oct.21, 2011, under C#

In order to display the data in a SqlDataReader object in a DataGridView control, you first need to load the data into a DataTable object. The code below is in C# and the Connection String is for a SQL Server database connection.

using System.Data.SqlClient;

SqlConnection con = new SqlConnection();
SqlCommand cmd = new SqlCommand();
SqlDataReader dr;

// set the connection string
con.ConnectionString = "Data Source=SqlServerName;Initial Catalog=DbName;Integrated Security=True"
con.Open();

string SQL = "SELECT * FROM tbl_Users";

// create the SQL command
cmd = new SqlCommand(SQL, con);

// execute the SQL
dr = cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);

DataTable table = new DataTable();
table.Load(dr);

reader.Close();
reader.Dispose();
con.Close();
con.Dispose();
cmd.Dispose();
cmd = null;

// Display the data in the DataGridView control...
DataGridView1.DataSource = table;
Share
Leave a Comment :, , , , , , , , , , , , , , , , , more...

iTunes Sync Error (-50)

by on Sep.25, 2011, under Aperture

About 3 months ago I began receiving the following error in iTunes when trying to sync a Smart Album in Aperture 3 to my iPad and iPhone 4.

“The iPad “Tom Gee’s iPad” cannot be synced. An unknown error occurred (-50).”

iTunes Error (-50)

iTunes Error (-50)

Narrowing down the picture(s) that were causing the issue was not a fast process because the Smart Album in question had 1,500+ images in it.  I began my troubleshooting process by adding a Date filter to the Smart Album and then syncing the updated album to my iPad via iTunes.  After about an hour, I identified the date that contained the photos which were causing the issue.

I then switched my Aperture Browser view to List View (see 1 below) and then scrolled through the data to see if anything looked odd to me.  Immediately, I saw that there a bunch of photos that had a Project Path of “Facebook” (see 2 below).  I right-clicked some of the photos and selected Show in Project, but there was no project found; simply an empty browser window.

Instead of deleting the photos from my Aperture library, I updated my Smart Album properties to exclude any items that contained the text “Facebook.”

Updated Smart Album Properties

Updated Smart Album Properties

After doing this, I tried syncing the Smart Album to my iPad via iTunes and all the photos/videos copied over without error!

I hope this helps others who may be having the same problem that I was! =D

Share
Leave a Comment :, , , , , , , , , , , , , , , , , , more...

Ian McKellen Impression–Fresh Prince Of Bel-Air

by on Sep.21, 2011, under Comedy, Uncategorized

[viddler id=9db9a6f0&w=437&h=288]

Share
Leave a Comment :, , , , , , , , , , , , , , , , , more...

Create a File Picker That Defaults to The Desktop (C#)

by on Sep.09, 2011, under C#

OpenFileDialog fd = new OpenFileDialog();

fd.InitialDirectory = Path.GetFullPath(Environment.GetFolderPath(Environment.SpecialFolder.Desktop));

fd.ShowDialog();

MessageBox.Show(fd.FileName); // show the selected File path
Share
Leave a Comment :, , , , , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

CLICK MEEEEE!