Sunday, August 19, 2012

Stop Clock Sync with host machine in Virtual PC

Hello everyone,
                        you might have noticed that whenever you change time in Virtual PC on a guest machine, it immediately synchronize it's time with the host machine, this can be very frustrated when you are working on an application which is time sensitive, like I had this problem when I was developing a Task Scheduler in C#

Anyways you can stop the clock synchronization between host machine and guest machine by following these steps

1. Open Virtual PC and start your guest Operating System

After it fully loads

2. Click on Start and than Click on Run and type services.msc

A window will pop-up listed all avalable services

3. Now here we have to find service

  •    Virtual Machine Additions Services Application
4. Right Click on the service and click on Stop

Note: You can also click on properties and set the startup type to Disabled, this way it will never starts at it's own, though you can manually start it later.

5. Close window

Now you can change the time in guest OS and this time it will not try to sync with the Host machine

I hope this for informative for you, And I would Like to thank you for reading

Saturday, August 11, 2012

Read textbox Buttons C#

   1:  private void BtnClick_Click(object sender, EventArgs e)
   2:    {
   3:      DialogResult Result;
   4:      Result = MessageBox.Show("Do you like my blog ? ", "Question", MessageBoxButtons.YesNo);
   5:        if (Result == DialogResult.Yes)
   6:           {
   7:               MessageBox.Show("You clicked on Yes :) ");
   8:           }
   9:         else if (Result == DialogResult.No)
  10:           {
  11:               MessageBox.Show("You clicked on NO  :( ");
  12:           }
  13:    }

In the above code
1. I have created a variable of DialogResult, (this variable will be use to store/identify which button did user press)

2. Than on line 5 we compare if the value in result variable equals to DialogResult.Yes than press

"You clicked on Yes"


"You Click on No"

I hope this was informative for you, and I would like to thank you for reading.