Visual Studio IDE Propertygrid的句柄 [英] Handle of the Visual Studio IDE Propertygrid

查看:60
本文介绍了Visual Studio IDE Propertygrid的句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道吗?
如何获得Visual Studio IDE本身的Propertygrid的句柄(设计时)?

这使我能够通过sendmessage API(具有自定义属性标签的自定义控件)来设置默认标签.
它非常适合如下的propertygrid控件:

Does anyone know ?
How can I get the Handle of the Propertygrid of the Visual Studio IDE itself (design time) ?

This makes me able to set the default tab through the sendmessage API (of a custom control with an custom propertytab).
It works perfectly for the propertygrid control like this:

Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal Hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
Public Const PG_CHANGE_TAB = &H451


Private Sub FormPropertyGrid_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.PropertyGrid1.CommandsVisibleIfAvailable = False
    Me.PropertyGrid1.SelectedObject = myActiveTextbox
    SendMessage(Me.PropertyGrid1.Handle, PG_CHANGE_TAB, 4, 0)
End Sub

推荐答案

我不认为它具有窗口句柄,因为Visual Studio IDE在WPF中已完全重做.它不使用普通的窗口.不过我可能是错的.

Spy ++似乎根本找不到窗口.
I don''t think it has a window handle as the Visual Studio IDE was completely redone in WPF. It doesn''t use normal windows. I could be wrong though.

Spy++ doesn''t seem to be able to find the window at all.


这篇关于Visual Studio IDE Propertygrid的句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆