How to make custom properties in Properties Window to refresh upon change via code?
-
Here is some code: ReadOnly Property X() As Integer Get Return PointerX End Get End Property ReadOnly Property Y() As Integer Get Return PointerY End Get End Property Private Sub Proj_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove PointerX = e.X PointerY = e.Y End Sub I want to make the Properties Window to update the properties for X and Y at each MouseMove, so they become immediately visible for the user. I know it is stupid, but it is my assignment. Can somebody help me?
-
Answer:
I would highly recommend pursuing this project in WPF using the OnPropertyChanged event to notify all listeners when a property is changed. Then, make the PropertyGrid listen to all such events on the object which it represents, updating the appropriate property. WPF is great for this stuff...
therealmitchconnors at Stack Overflow Visit the source
Other answers
That's not a Windows Form project. You created a Windows Control Library which includes a default UserControl and when you "run", you are seeing your UserControl being hosted, which is why you are seeing a PropertyGrid control. You need to create or add a new project to your solution that is a Windows Form Application, and set it as the "Starup Project" (right mouse click the Form project and select "Set as Startup Project"). After you rebuild your solution, your UserControl "Proj" will be available from the ToolBox, which you can place on your form.
LarsTech
Related Q & A:
- How To Make A Custom Motorcycle?Best solution by Yahoo! Answers
- How to make my own Android custom calendar?Best solution by Stack Overflow
- How do i make custom songs for guitar hero 3?Best solution by Yahoo! Answers
- How to make change in a team?Best solution by Yahoo! Answers
- How to make my own custom designed shirt?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.