I have created a custom control in WPF with VB .NET as the background code. The control is a rounded rectangle with another rectangle and a clipping mask to simulate an inner shadow effect when the MouseDown event occurs. I am going to develop menu buttons and toggle buttons out of this.
The problem that I am experiencing is that the very first time I click on the control, there is a significant delay between the time I click and the time that the MouseDown event draws the UI for the control. On subsequent clicks, everything occurs instantly. This is undesirable.
I have attached my source code with a compiled windows form included. The source code is not documented, but is very simple; just threw it together very quickly. Two questions:
1. Could you guys run this form and see if you can replicate the problem?
2. I would appreciate any suggestions for getting around this problem.
This is my first time with a WPF application and there are already some things I don't like about it, but maybe I'm making some obvious error here.
Question
boogerjones
I have created a custom control in WPF with VB .NET as the background code. The control is a rounded rectangle with another rectangle and a clipping mask to simulate an inner shadow effect when the MouseDown event occurs. I am going to develop menu buttons and toggle buttons out of this.
The problem that I am experiencing is that the very first time I click on the control, there is a significant delay between the time I click and the time that the MouseDown event draws the UI for the control. On subsequent clicks, everything occurs instantly. This is undesirable.
I have attached my source code with a compiled windows form included. The source code is not documented, but is very simple; just threw it together very quickly. Two questions:
1. Could you guys run this form and see if you can replicate the problem?
2. I would appreciate any suggestions for getting around this problem.
This is my first time with a WPF application and there are already some things I don't like about it, but maybe I'm making some obvious error here.
controlProject.zip
Link to comment
Share on other sites
1 answer to this question
Recommended Posts