I recently could not double click on a folder and have it open the contents.
Run Regedit, find HKEY_CURRENT_USER/Control Panel/Mouse.
Delete the value data in DoubleClickHeight, DoubleClickWidth and DoubleClickSensitivity.
Go into Control Panel, Mouse, Doubleclick speed, move the pointer to a very slow position.
Friday, January 8, 2010
Thursday, October 29, 2009
Simple Print Window in WPF (PDF and DOC)
I struggled with this for a few hours because the window would not close when the application closed using a WindowsFormHost and the solution was tons simpilar than I thought to begin with.
You make a window:
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowState="Maximized"
Icon="/MyProj;component/Images/favicon.ico"
Title="MyProj - Print">
Then the code behind is simple:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace MyProj
{
///
/// Interaction logic for PrintPDFWindow.xaml
///
public partial class PrintPDFWindow : Window
{
private System.Windows.Forms.WebBrowser webbrowserOne;
public PrintPDFWindow()
{
InitializeComponent();
}
public PrintPDFWindow(string filePath)
{
InitializeComponent();
Uri uri = new Uri(filePath, UriKind.RelativeOrAbsolute);
this.webBrowser.Source = uri;
}
}
}
You call it like this:
PrintPDFWindow ppw = new PrintPDFWindow(currentMarketingPath + currentMarketingMaterial.MarketingMaterialURL);
ppw.Title = "MyProj - " + currentMarketingMaterial.MarketingMaterialName;
ppw.Show();
That is it!
You make a window:
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowState="Maximized"
Icon="/MyProj;component/Images/favicon.ico"
Title="MyProj - Print">
Then the code behind is simple:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace MyProj
{
///
/// Interaction logic for PrintPDFWindow.xaml
///
public partial class PrintPDFWindow : Window
{
private System.Windows.Forms.WebBrowser webbrowserOne;
public PrintPDFWindow()
{
InitializeComponent();
}
public PrintPDFWindow(string filePath)
{
InitializeComponent();
Uri uri = new Uri(filePath, UriKind.RelativeOrAbsolute);
this.webBrowser.Source = uri;
}
}
}
You call it like this:
PrintPDFWindow ppw = new PrintPDFWindow(currentMarketingPath + currentMarketingMaterial.MarketingMaterialURL);
ppw.Title = "MyProj - " + currentMarketingMaterial.MarketingMaterialName;
ppw.Show();
That is it!
Friday, October 16, 2009
WPF Horizontal Listbox Bad Keyboard Behavior
What a pain in the arse. Took me hours to find this.
I have a horizontal listbox resembling a filmstrip. It had images on it. A mouse click on the next item in the scrollbar produced a correct onselectionchanged event. Arrowing right or left did not product the correct selected index. An Arrow Key Right it went to index 0. An Arrow Key Left went to the last item in the list.
I overrode the listbox class with the following code:
public class HorizontalListBox : ListBox
{
protected override void OnKeyDown(KeyEventArgs e)
{
KeyDownHandler(this, e);
e.Handled = true;
}
void KeyDownHandler(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == System.Windows.Input.Key.Left)
{
MoveUp();
}
if (e.Key == System.Windows.Input.Key.Right)
{
MoveDown();
}
}
void MoveUp()
{
if (this.SelectedIndex > 0)
{
this.SelectedIndex = this.SelectedIndex - 1;
}
}
void MoveDown()
{
try
{
this.SelectedIndex = this.SelectedIndex + 1;
}
catch { }
}
}
Happy coding!
Linda
I have a horizontal listbox resembling a filmstrip. It had images on it. A mouse click on the next item in the scrollbar produced a correct onselectionchanged event. Arrowing right or left did not product the correct selected index. An Arrow Key Right it went to index 0. An Arrow Key Left went to the last item in the list.
I overrode the listbox class with the following code:
public class HorizontalListBox : ListBox
{
protected override void OnKeyDown(KeyEventArgs e)
{
KeyDownHandler(this, e);
e.Handled = true;
}
void KeyDownHandler(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == System.Windows.Input.Key.Left)
{
MoveUp();
}
if (e.Key == System.Windows.Input.Key.Right)
{
MoveDown();
}
}
void MoveUp()
{
if (this.SelectedIndex > 0)
{
this.SelectedIndex = this.SelectedIndex - 1;
}
}
void MoveDown()
{
try
{
this.SelectedIndex = this.SelectedIndex + 1;
}
catch { }
}
}
Happy coding!
Linda
Tuesday, October 13, 2009
WPF Application Icon when StartURL is a Page
Create an LoadCompleted event on the application (App.xaml).
LoadCompleted="Application_LoadCompleted"
private void Application_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
{
System.Drawing.Bitmap bmp = global::Docs.Properties.Resources.favicon.ToBitmap();
MemoryStream strm = new MemoryStream();
bmp.Save(strm, System.Drawing.Imaging.ImageFormat.Png);
strm.Seek(0, SeekOrigin.Begin);
PngBitmapDecoder pbd = new PngBitmapDecoder(strm, BitmapCreateOptions.None, BitmapCacheOption.Default);
//((System.Windows.Navigation.NavigationWindow)(Application.Current.MainWindow)).Icon = pbd.Frames[0];
Application.Current.MainWindow.Icon = pbd.Frames[0];
Application.Current.MainWindow.Top = 0;
Application.Current.MainWindow.Left = 0;
}
Took me a couple of hours to find this one.
~Linda
LoadCompleted="Application_LoadCompleted"
private void Application_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
{
System.Drawing.Bitmap bmp = global::Docs.Properties.Resources.favicon.ToBitmap();
MemoryStream strm = new MemoryStream();
bmp.Save(strm, System.Drawing.Imaging.ImageFormat.Png);
strm.Seek(0, SeekOrigin.Begin);
PngBitmapDecoder pbd = new PngBitmapDecoder(strm, BitmapCreateOptions.None, BitmapCacheOption.Default);
//((System.Windows.Navigation.NavigationWindow)(Application.Current.MainWindow)).Icon = pbd.Frames[0];
Application.Current.MainWindow.Icon = pbd.Frames[0];
Application.Current.MainWindow.Top = 0;
Application.Current.MainWindow.Left = 0;
}
Took me a couple of hours to find this one.
~Linda
Saturday, September 27, 2008
Bailout
The bailout is intended to rescue bankers from the bad loans that threaten to derail the economy and plunge the country into a long depression.
What about people like me who have paid their loans on time every time. I haven't taken out a loan that I could not pay back. I have been turned down by banks in favor for someone who would not pay their debts.
Disgusting!
I heard Debrah Orman on Oprah this week saying to only place your cash in an account backed by the government nothing else. She suspects some of the banks will go under. This is very scary!
Myself? I am stockpiling a bit of food.
What about people like me who have paid their loans on time every time. I haven't taken out a loan that I could not pay back. I have been turned down by banks in favor for someone who would not pay their debts.
Disgusting!
I heard Debrah Orman on Oprah this week saying to only place your cash in an account backed by the government nothing else. She suspects some of the banks will go under. This is very scary!
Myself? I am stockpiling a bit of food.
Monday, September 22, 2008
Letting Go
"Letting Go''
To ....let go'' does not mean to stop caring...
It means I can't do it for someone else.
To ....let go'' is not to cut myself off.
It's the realization I can't control another.
To ....let go'' is not to enable,
but to allow learning from natural consequences.
To ....let go'' is to admit powerlessness
which means the outcome is not in my hands.
To ....let go'' is not to try to change or blame another.
It's to make the most of myself.
To ....let go'' is not to care for, but to care about.
To ....let go'' is not to fix, but to be supportive.
To ....let go'' is not to judge,
but to allow another to be a human being.
To ....let go'' is not to be in the middle arranging all the outcomes,
but to allow others to affect their own destinies.
To ....let go'' is not to be protective.
It's to permit another to face reality.
To ....let go'' is not to deny, but to accept.
To ....let go'' is not to nag, scold, or argue,
but instead to search out my own shortcomings and correct them.
To ....let go'' is not to criticize and regulate anybody,
but to try to become what I dream I can be.
To ....let go'' is not to adjust everything to my desires
but to take each day as it comes and cherish myself in it.
To ....let go'' is to not regret the past,
but to grow and live for the future.
To ....let go'' does not mean to stop caring...
It means I can't do it for someone else.
To ....let go'' is not to cut myself off.
It's the realization I can't control another.
To ....let go'' is not to enable,
but to allow learning from natural consequences.
To ....let go'' is to admit powerlessness
which means the outcome is not in my hands.
To ....let go'' is not to try to change or blame another.
It's to make the most of myself.
To ....let go'' is not to care for, but to care about.
To ....let go'' is not to fix, but to be supportive.
To ....let go'' is not to judge,
but to allow another to be a human being.
To ....let go'' is not to be in the middle arranging all the outcomes,
but to allow others to affect their own destinies.
To ....let go'' is not to be protective.
It's to permit another to face reality.
To ....let go'' is not to deny, but to accept.
To ....let go'' is not to nag, scold, or argue,
but instead to search out my own shortcomings and correct them.
To ....let go'' is not to criticize and regulate anybody,
but to try to become what I dream I can be.
To ....let go'' is not to adjust everything to my desires
but to take each day as it comes and cherish myself in it.
To ....let go'' is to not regret the past,
but to grow and live for the future.
To ....let go'' is to fear less and LOVE MYSELF MORE.
Monday, July 21, 2008
Define Success
So a friend of mine gave me a book for my birthday. It is called "The Secret". She has told me many times that I am already living my dream. After I have made some lucrative business deals, purchased a big house, purchased beautiful furniture and made sure my kids are healthy and happy I have to wonder what is next on the agenda for me.
I try to help people realize the value of positive thinking. If you are constantly in the negative zone then you will be extremely unhappy. Another aspect of positive thinking is to make sure you are grateful for what you have. I think at any time a person can hit rock bottom.
I want people to realize there is so much out there if you believe in yourself and help other people to do the same. So how do I define success?
First I would break it down into several areas of success.
Professional Success
If I am successful professionally then I have not only climbed the career ladder and am well respected in my field but I have also helped others to do the same thing. By helping them improve professionally I am also improving myself professionally. I can inspire and motivate even the lowliest person to do better in their career.
Personal Success
I define personal success as having the ability to love myself. Putting my professional success aside and realizing what is important in life. Family and friends should remain at the top and their happiness and well being is very important to me. To live a long life I also think a person is successful by making their mind, body and soul healthy.
Human Success
I am successful in the human race if I have shown compassion and service to others. I am also successful if have brightened the most depressed person on earth with my smile. I want to make a positive influence in people's lives and make them glad that they met me. Making people laugh is the greatest thing on earth. Even if they are laughing at my corny jokes or reading the constant stream of humor email I send out.
Overall
I want to go to bed at night and sleep because I know I have achieved success that day. I want to die with no regrets. There is that old saying about sliding into the grave not saying "Geez I can't believe my life is over" but saying…"GAWD…what a ride!" I want to take risks and never have regrets.
The point is success is not about the money I have made or the places I have been. The best success in life is how well I respect myself. If I have done the things that I know are right then I will respect myself and others will respect me too.
I try to help people realize the value of positive thinking. If you are constantly in the negative zone then you will be extremely unhappy. Another aspect of positive thinking is to make sure you are grateful for what you have. I think at any time a person can hit rock bottom.
I want people to realize there is so much out there if you believe in yourself and help other people to do the same. So how do I define success?
First I would break it down into several areas of success.
Professional Success
If I am successful professionally then I have not only climbed the career ladder and am well respected in my field but I have also helped others to do the same thing. By helping them improve professionally I am also improving myself professionally. I can inspire and motivate even the lowliest person to do better in their career.
Personal Success
I define personal success as having the ability to love myself. Putting my professional success aside and realizing what is important in life. Family and friends should remain at the top and their happiness and well being is very important to me. To live a long life I also think a person is successful by making their mind, body and soul healthy.
Human Success
I am successful in the human race if I have shown compassion and service to others. I am also successful if have brightened the most depressed person on earth with my smile. I want to make a positive influence in people's lives and make them glad that they met me. Making people laugh is the greatest thing on earth. Even if they are laughing at my corny jokes or reading the constant stream of humor email I send out.
Overall
I want to go to bed at night and sleep because I know I have achieved success that day. I want to die with no regrets. There is that old saying about sliding into the grave not saying "Geez I can't believe my life is over" but saying…"GAWD…what a ride!" I want to take risks and never have regrets.
The point is success is not about the money I have made or the places I have been. The best success in life is how well I respect myself. If I have done the things that I know are right then I will respect myself and others will respect me too.
Subscribe to:
Posts (Atom)
