|
There is no selection changed event in treeview.
|
|
|
|
|
You are right. There are two. BeforeSelect, and AfterSelect. So, use whichever one you prefer, and as the selection changes, select the right node in the other control.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
Well, if the control is broken, if the events that should fire, do not, then your only other option as far as I can see, is to use a timer to check when one is changed, and then change the other, or use the keyboard events to detect when a keypress occurs on the control, and then from there, check if the selection has changed.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Your code sucks. I just wrote a sample project and it works just fine. Press a key to change selection and the beforeselect and afterselect events fire, with a keyup event in the middle.
If you want help here, it helps to post your code, so we can tell you where it is broken, although in this case, it's very simple. Hook up the event, and it will fire.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks a lot for replying me.
My two trees worked with the following code.
private void sourcetree_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Up)
{
if(destinationtree.SelectedNode.PrevVisibleNode != null)
destinationtree.SelectedNode = destinationtree.SelectedNode.PrevVisibleNode;
}
else
{
if(destinationtree.SelectedNode.NextVisibleNode != null)
destinationtree.SelectedNode = destinationtree.SelectedNode.NextVisibleNode;
}
}
|
|
|
|
|
Christian Graus wrote: Your code sucks
I've not been around for about 8 months - first post I read shows not much as changed around here!! Superb.
Knowledge is hereditary, it will find its way up or down.
Luc Pattyn
and since what every time when i want to add button to this control one add two times
posted in C# forum
|
|
|
|
|
Christian Graus wrote: Your code sucks.
Hey, you're back.
|
|
|
|
|
Hi,
I am developing a window application in WPF using MVVM pattern. I am not getting how to set focus on a control in MVVM pattern.
Please help.
Thanks
Amit
Amit
|
|
|
|
|
We have a WPF forum. What is the MVVM pattern ? I think we've become too obsessed with idiotic patterns that are used to try to be trendy. If a pattern does not suit your app, don't use it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
Hello...
I'm new to WCF. I'm working on a architecture where I need to convert my Business object class to Data Transfer Object class for accessing web service. At the same time I need to do the opposite. but I don't know how to this conversion?
Any help would be appreciated, specially with code sample.
Thanking in Advance
Johnny
|
|
|
|
|
I'd be astounded if half the point of WCF was not that it offers this type of serialisation for you. Even web services, which WCF will wrap, I believe, will do that for you.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks for your quick response.
Actually i have to transfer the business object from my Desktop app to a remote WCF service .That's why
i think i have to convert my business object to DTO and vice versa.
How can i do this?
|
|
|
|
|
I don't know for sure, I just know that if you need to do any sort of conversion, then WCF only makes it harder to use a webservice, because I've written plenty of webservice clients and webservices, without ever having to do this.
Also, please don't cross post.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hello Johnny,
converting a BO to a DTO is a manual task which has to be done by yourself and not by WCF. But there is a sweet library called AutoMapper (http://automapper.codeplex.com/[^]) I can highly recommend. Its a convention-based object-object mapper which can handle the BO-to-DTO mapping and vice versa for you. Take a look and enjoy
Greetings,
Tobias
|
|
|
|
|
hi, trying to add a .wav file to my project's resources, and play it through axWindowsMediaPlayer1.
Problem is i dont quite know how to tell the axWindowsMediaPlayer1 where the file is.
I have tried the following:
WindowsFormsApplication1.Properties.Resources.tune (tune being the wav file)
except now the player has a problem because of no file extension, and if i add an extension, it plays nothing.
WindowsFormsApplication1.Properties.Resources.tune.wav (plays nothing, you can see why)
any help would be appreciated, thanks.
|
|
|
|
|
I don't think this will work, I've only ever been able to get WMP to play files in the file system. Unless you can set up a web server and make it think it's coming from an online source.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
In the Solution Explorer you can open the directory named Resources,click tune.wav.
Change its first advanced properties,so it would copy the wav file to the the directory where your program is.
axWindowsMediaPlayer1.URL = Application.StartupPath + "\\Resources\\tune.wav";
You can have a try.
My English is just so so,wish it can help you.
|
|
|
|
|
thaks for the replies, but is there anyway i can somehow pack the wav file into the program? i would rather it not be separate. thanks.
|
|
|
|
|
See this[^] article.
/ravi
|
|
|
|
|
Hi friends,
If some one knows about any link or article on mshtml Event Object Model
Please lead me ....
Thanks
|
|
|
|
|
|
In C++ I can pass parameters by value/reference(using &).
If I create an instance of a class using the new keyword in C++, and pass the pointer pointing to it by reference (reference to pointer, e.g. MyClass &* ptr), is it the same as passing a ref type by ref in C#?
As in both cases, the callee can change the object’s state, as well as point/refer to other objects.
What do you think?
|
|
|
|
|
I think the only way to be sure is to write some test code. I suspect you are wrong, in that you can't dereference a reference in C#, I think that ref basically is worthless if it's already a ref type, it adds nothing.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|