❔ [WPF] How to input ComboBox into TextBlock
I wanna locate combobox's location in TextBlock inner when I Click TextBlock on mouseRightDownClick event https://paste.mod.gg/yjkugolgnlcs/3 this is my code. I think combobox can't make in xaml file. just can make in cs file. but I don't know how to input combobox to TextBlock inner
BlazeBin - yjkugolgnlcs
A tool for sharing your source code with the world!
8 Replies
So, I suppose you want to show some kind of context menu at the location of the combobox and you need to find the location for that?
yes, that context menu is that TextBlock. Im doing clone coding target of Sticky notes , and you can find in picture that i want
https://paste.mod.gg/yjkugolgnlcs/3 this is my code, and I think combobox can't make in xaml file. just can make in cs file
BlazeBin - yjkugolgnlcs
A tool for sharing your source code with the world!
You have to add a contextmenu element to your textblock
It already exists 😄 you just have to put in, what you need
https://wpf-tutorial.com/common-interface-controls/contextmenu/
thanks your solution I try it !
I resolved it , thanks I reference your paper and https://learn.microsoft.com/en-us/dotnet/desktop/wpf/controls/contextmenu-overview?view=netframeworkdesktop-4.8
ContextMenu Overview - WPF .NET Framework
This article provides an overview of the ContextMenu class, which represents the element that exposes functionality by using a context-specific Menu.
👍
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.