controls

Custom TreeNode bounds

a 夏天 提交于 2021-02-08 04:37:58
问题 How to extend the standard mouse behavior of a TreeView node (like selecting, hot tracking, expansion on double click etc.) over a wider node area? I've got a custom-drawn node that has a wider label than it would have if it was system-drawn and it only reacts to mouse actions when the cursor is within the ordinary node bounds. Any Ideas? BTW, intercepting TVM_GETITEMRECT and TVM_HITTEST won't do the trick. A few words about what I'm doing: I'm developing a WinForms tree control that normally

Custom TreeNode bounds

狂风中的少年 提交于 2021-02-08 04:37:25
问题 How to extend the standard mouse behavior of a TreeView node (like selecting, hot tracking, expansion on double click etc.) over a wider node area? I've got a custom-drawn node that has a wider label than it would have if it was system-drawn and it only reacts to mouse actions when the cursor is within the ordinary node bounds. Any Ideas? BTW, intercepting TVM_GETITEMRECT and TVM_HITTEST won't do the trick. A few words about what I'm doing: I'm developing a WinForms tree control that normally

Is there a way to get a reference to all the child windows or controls on an MFC dialog, given that I have a CWnd object referencing that control?

六月ゝ 毕业季﹏ 提交于 2021-02-08 03:44:34
问题 Lets say I have an MFC Dialog with several buttons on it. (E.g. "Red", "Blue", "Green", and "Yellow" buttons) These buttons all have IDs such as ("IDC_BUTT_RED","IDC_BUTT_BLUE","IDC_BUTT_GREEN","IDC_BUTT_YELLOW") Given that I have a CWnd object that references the dialog window that these buttons are placed on. Is there a way to get a list of these IDs? I know there is a CWnd::GetNextDlgGroupItem method, that based on the description should iterate through a group of controls. I tried using

Sizing WPF controls to an exact percentage

℡╲_俬逩灬. 提交于 2021-02-05 05:39:25
问题 In WPF, I want set a controls width to be, say, 97% of it's Parent controls ActualWidth property. How can I do this? 回答1: You can use Grid panel. E.g: <Border> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="0.97*"/> <ColumnDefinition Width="0.03*"/> </Grid.ColumnDefinitions> <Button Content="97%"/> <Border Grid.Column="1" Background="Green"> </Border> </Grid> </Border> Grid will occupy 100% of available border's size. First column will use 97% of it. And the rest 3% are given to

Sonos control api: polling rate & subscription

99封情书 提交于 2021-01-29 05:30:44
问题 We are controlling the sonos via a small IOT device. This device will be placed at the homes of our customers. In our home automation system we need to know the playbackstate + volume of the players/groups. At which polling rate can we ask these parameters ? We cannot use a cloud server to handle the subscription events. I tried to put a https webservice in the IOT device with a self signed certificate but this doesn't work. After I have posted the subscription I get a request in my

How to bind a treeview in UWP to a ViewModel?

≡放荡痞女 提交于 2021-01-28 09:35:43
问题 I am currently working in UWP and I need to create a TreeView to store hierarchically a query of a service. example: Example I have I keep the information in a public ObservableCollection <Model> name_of_object {get; set; } = new ObservableCollection <Model> (); But I create the TreeView in the XAML and I do not see any way to do a Binding to the "SelectedItem" and "ItemSource" or any way to bring a query. Tried this solution: Recursive XAML binding data templates on the Universal Windows

How to implement advanced custom properties in VB6 usercontrols?

北城余情 提交于 2021-01-28 05:59:11
问题 Sorry I don't know how to name it other than "advanced custom properties". If I know, I would search it first. I am dealing with a legacy code using 3-rd party controls. In VB6, When you drag that control onto the form, you can see all the properties supported by the control in the "Properties" window. Such as MarginLeft, MarginRight etc. etc. That's no problem. In the "Property" window, the top-most property is generally the "(Name)" field, which is the name of the control. But the 3-rd

Page Load being called before Button Event in .net

你说的曾经没有我的故事 提交于 2021-01-28 01:50:47
问题 I have the following code: protected void Page_Load(object sender, EventArgs e) { //get questions List<Question> questions = Question.GetQuestionsForTesting(); //for each question foreach (Question currQuestion in questions) { //display the questionAnswer control QuestionAnswer newControl = (QuestionAnswer)LoadControl("~/Account/QuestionAnswer.ascx"); newControl.newQuestion = currQuestion; questionAnswerPanel.Controls.Add(newControl); } } protected void submitAnswers_Click(object sender,

google maps api v3: handle user click on map type control?

十年热恋 提交于 2021-01-28 01:11:21
问题 I need to handle the case when a user clicks on a mapTypeControl differently than when it's set through map.setMapTypeId() . How do I listen for clicks on map type controls? 回答1: You can't listen for events on the default UI control set. But if you are strictly focused on differentiating between clicks on the mapTypeControl and map.setMapTypeId() , you could use the fact that you control the code that may call setMapTypeId() and add some state management code: // First, add a new state var:

What are the side-affects of ensuring every control created has a handle in .NET?

混江龙づ霸主 提交于 2021-01-27 06:31:40
问题 In the past, I've suffered from a freezing issue that was the result of a Control being used to marshall calls on the UI thread before a handle has been created for that control. (See Kim Greenlee's blog for more info). Using this method - implemented recursively - I ensure all controls that are created in our application have handles when they are constructed. Specifically, this is done after the designer call to initialise the GUI for the control. My question is: Q - Aside from performance,