ningzhong
路人甲
路人甲
  • 注册日期2005-11-07
  • 发帖数1
  • QQ
  • 铜币61枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1764回复:2

[求助]怎样在c#+ao中打开属性查询的对话框?

楼主#
更多 发布于:2006-11-06 10:37
<P> </P>
<P>在帮助文档里看到这些vba代码,可是我又不知道怎样转成c#。</P>
<P><FONT color=#0000ff>Public Sub</FONT> AttributeQuery()<BR>  <CODE><FONT color=#0000ff>Dim</FONT></CODE> pQueryAttributes <CODE><FONT color=#0000ff>As</FONT></CODE> IQueryAttributes<BR>  <CODE><FONT color=#008000>'Create a new Query Attribute Dialog and set</FONT></CODE><BR>  <CODE><FONT color=#008000>'some necessary properties before launching it</FONT></CODE><BR>  <CODE><FONT color=#0000ff>Set</FONT></CODE> pQueryAttributes = <CODE><FONT color=#0000ff>New</FONT></CODE> QueryAttributes<BR>  <CODE><FONT color=#0000ff>Set</FONT></CODE> pQueryAttributes.Application = <FONT color=#ff0000>Application</FONT><BR>  pQueryAttributes.SelectFeaturesInLayerOnOK = <CODE><FONT color=#0000ff>True</FONT></CODE><BR>  <CODE><FONT color=#008000>'Provide a default expression if desired</FONT></CODE><BR>  pQueryAttributes.Expression = """NAME"" = 'Halifax'"<BR>  <CODE><FONT color=#008000>'Lauch the dialog</FONT></CODE><BR>  pQueryAttributes.DoModal Application.hWnd<BR><CODE><FONT color=#0000ff>End Sub</FONT></CODE><BR></P>

<P>这里的application在c#中用什么来代替?</P>
<P>最后一句写成pQueryAttributes.DoModal this.handle.toint32();又出错了。麻烦高手看一下啊!</P>
喜欢0 评分0
hsghxm
路人甲
路人甲
  • 注册日期2004-10-27
  • 发帖数517
  • QQ4604052
  • 铜币1枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2006-11-06 16:46
C#,不提供这样的东东,属性查询的功能要自己写代码的,不过这些代码都是最最基本的!对初学者来说练习写这样的东西还是很不错的
MSN:hsghxm@163.com QQ:4604052 (很少用,最好别加) Email:hsghxm@163.com 我的BOLG:http://www.gisempire.com/blog/user1/864/index.htm
举报 回复(0) 喜欢(0)     评分
hahaaluo
路人甲
路人甲
  • 注册日期2006-08-05
  • 发帖数146
  • QQ
  • 铜币591枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2006-11-08 19:32
是的  确实对于初学者来这样做是很有帮助的
举报 回复(0) 喜欢(0)     评分
游客

返回顶部