-
-
Yesterday, we have successfully hidden a form when a user press a button. Today, we are going to make it show back.
The hidden form is not unloaded from memory, so it can still run codes. But since it is hidden, a user cannot interact with the form. The easiest way to overcome this problem is using a component, such as Timer. Set a timeout, and when it hits, show the form back. Here's how:
- Add a Timer and a NumericUpDown control to the form. Leave it using the default name.
- Add the following code right after the Me.Hide() line on the KeyDown event handler:
Me.Timer1.Interval = Me.NumericUpDown1.Value
Me.Timer1.Enabled = True
This code sets the timeout based on the value on the NumericUpDown1 control, and starts the timer.
- Add a new event handler for Timer1.Tick, this event is triggered when the timeout have elapsed. Add the following code to the method:
Me.Timer1.Enabled = False
Me.Show()
- Test it out by filling 1000 to the NumericUpDown1 control, and hit the Boss Key. The form should pop back up in 1 seconds.
P.S.: The whole code should read like this:
Private Sub MainForm_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.F12 Then
Me.Hide()
Me.Timer1.Interval = Me.NumericUpDown1.Value
Me.Timer1.Enabled = True
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Timer1.Enabled = False
Me.Show()
End Sub
-
-
Today, Playboy has marked another milestone in it's life. The first edition of Playboy Indonesia has been published and sold to public. Andara Early is the first cover, and the mag is priced at Rp39.000.
This post is not about the content of the magazine, but how it is presented. It has an extended cover design, just like the InfoKomputer magazine usually have. But when InfoKomputer displays three- to four-page wide ads, Playboy Indonesia displays a fake cover from a cellular phone magazine. That way, you can read Playboy without worrying that anyone would notice what you're reading. The others see that you are reading the cell phone mag. Smart!
This sparks my memory back to decades ago where DOS rules IBM PCs everywhere. Remember those cute games that runs on text-based User Interface? Some of them have the smart Boss Key feature. Press this key, and you are presented with a fake spreadsheet or word processing application.
How to create this feature in .NET? It is very easy. Here's how:
- Select a key that functions as Boss Key, either design-time or let the user choose it. We are going with predefined key F12 for this example.
- Handle the KeyDown event in the form you wanted to hide when the Boss Key is pressed.
- Add the following code to the event handler:
If e.KeyCode = Keys.F12 Then
Me.Hide()
End If
- That way, everytime you press F12, the form will be hidden. It doesn't even show in the Taskbar.
You've managed to hide it, but how do you display it back? That's a question for tomorrow's post. Keep tuned!
-
-
Several weeks ago, I posted a question about what notebook suits me best. I got the answer today.
I'm going for the MacBookPro, definitely. Not only it runs MacOS X natively, it also runs Windows XP natively. Surely, this is something that IBM PCs don't have.
Using this configuration, I wish that I can do my programming on Windows XP (or preferably, Windows Vista), and run it on the MacOS X using Rotor SSCLI. Wow!
-
-
We're in Indonesia have just got our drop of Windows Vista build 5308 from our beloved marketing (you know who). I'm assuming that all of you have already got it and installed the build. I got the build from MSDN Subscriber Download, and have already installed it around a month ago. Unfortunately, I have to make a decision to uninstall the build. Here's my reasons:
- The build just not met several quality expectation, yet.
- I need the 10gig space occupied by Windows Vista installation.
- I loved Windows Media Center, and since I can run it on Windows XP Professional, I don't need Windows Vista, for now.
Performing uninstall is easy, just format the partition where Windows Vista exists. The problem is, the boot sector that got replaced by Windows Vista bootloader does not automagically revert back to the original Windows XP bootloader. To address this problem, follow the following steps:
- You will need the original Windows XP installation CD, restart your box and reboot to the installation.
- Continue until you are given the option to either Install Windows XP or Repair using Recovery Console. Run the Recovery Console.
- Choose the primary Windows installation, usually the one that sits on the boot partition.
- Type “fixboot“, and follow instructions. Type “exit“ and enjoy your classic bootloader.
- After booting to Windows XP, you can safely remove boot related directory (boot) and files (boot.BAK, BOOTSECT.BAK).
-
-
OK, most of you should already realize that the previous post is an April Fool's joke. There's no such benefits for a Student Ambassador, there's no Most Valuable Student Ambassador award (yet!), there's not even a single e-mail from BillG to me. All of them are just plain made up.
- The e-mail content comes from MCA post. Did a Find and Replace for all MVP to MVSA.
- The logo was made using Expression (I'm moving to this tool, 100 megs for Photoshop and Draw, definitely a good deal), based on MCA post above.
The post definitely broke a new record. 2000 page view in three days. I'm also thanking for people who clicked on the Google Ad links, helps a lot!
What's next?
Of course, it's not going to be another joke. We're going to do several tours to some education institution, doing workshops on Express. Already lined up are four institution, with two finalizing the deal. Hope to see you guys, soon!
-
-
This morning, April 1 2006, I have received the following e-mail:
Dear Adrian Godong,
Congratulations and Welcome to the Microsoft MVSA Program!
As a recipient of this year’s Most Valuable Student Ambassador award, you join an elite group of students in online and offline technical communities around the world who share their passion for Microsoft products and technologies with others.
Microsoft salutes all MVSAs for promoting the spirit of community by helping other people realize their potential through technology. To learn more about the MVSA Program, visit: www.microsoft.com/mvsa.
Your extraordinary efforts guiding your peers in Marketing Track technical communities during the past year are greatly appreciated. The benefits you will enjoy as part of the MVSA Program are outlined below, starting April 1 2006.
- Monthly non-taxable cash support of USD1,000. Transferable to your local currency, current rates apply.
- Full subscription of MSDN Universal (upgradeable to MSDN Premium with Visual Studio 2005 Team Suite using enclosed promotional code).
- Yearly trip to Redmond Campus.
- Full scholarship options for master degree at Massachusetts Institute of Technology.
You can also start using the logo below:

Nice!