使用C#进行转换

编程入门 行业动态 更新时间:2024-10-21 06:04:37
本文介绍了使用C#进行转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

以下VB的C#equivelant是什么: CType(controlTemplate,TextBox).Text ="" 我基本上试图在我的函数中使用一个更通用的对象作为参数,然后根据其类型更改函数内的行为 。 br /> 问候, David P. Donahue dd ****** @ ccs.neu.edu

What is the C# equivelant of the following VB: CType(controlTemplate, TextBox).Text = "" I''m basically trying to use a more general object as an argument in one of my functions and then change the behavior within the function based on its type. Regards, David P. Donahue dd******@ccs.neu.edu

推荐答案

David, 你会这样做: //转换为文本框并设置文本属性。 ((TextBox)controlTemplate).Text = string 。空; 希望这会有所帮助。 - - Nicholas Paldino [.NET / C#MVP] - mv*@spam.guard.caspershouse David P. Donahue <峰; dd ****** @ ccs.neu.edu>在消息中写道 新闻:Og ************** @ TK2MSFTNGP09.phx.gbl ... David, You would do this: // Cast to a textbox and set the text property. ((TextBox) controlTemplate).Text = string.Empty; Hope this helps. -- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse "David P. Donahue" <dd******@ccs.neu.edu> wrote in message news:Og**************@TK2MSFTNGP09.phx.gbl... 什么是C#equivelant下面的VB: CType(controlTemplate,TextBox).Text ="" 我基本上试图使用更通用的对象作为参数我的功能之一,然后根据其类型更改功能中的行为。 问候, David P. Donahue dd ****** @ ccs.neu.edu What is the C# equivelant of the following VB: CType(controlTemplate, TextBox).Text = "" I''m basically trying to use a more general object as an argument in one of my functions and then change the behavior within the function based on its type. Regards, David P. Donahue dd******@ccs.neu.edu

嗨David, 使用: ((TextBox)controlTemplate).Text ="" HTH, Rakesh Rajan " David P. Donahue"写道: Hi David, Use: ((TextBox)controlTemplate).Text = "" HTH, Rakesh Rajan "David P. Donahue" wrote: 以下VB的C#equivelant是什么: CType(controlTemplate,TextBox).Text ="" <我基本上试图在我的函数中使用一个更通用的对象作为参数,然后根据其类型改变函数内的行为。 David P. Donahue dd******@ccs.neu。 edu What is the C# equivelant of the following VB: CType(controlTemplate, TextBox).Text = "" I''m basically trying to use a more general object as an argument in one of my functions and then change the behavior within the function based on its type. Regards, David P. Donahue dd******@ccs.neu.edu

equivelent是演员运营商 ((TextBox)controlTemplate).Text =""; 问候 Richard Blewett - DevelopMentor staff.develop/richardb/weblog 什么是以下VB的C#equivelant: CType(controlTemplate,TextBox).Text ="" 我基本上是试图使用一个更通用的对象作为我的函数的一个参数,然后根据其类型更改函数内的行为 。 The equivelent is the cast operator ((TextBox)controlTemplate).Text = ""; Regards Richard Blewett - DevelopMentor staff.develop/richardb/weblog What is the C# equivelant of the following VB: CType(controlTemplate, TextBox).Text = "" I''m basically trying to use a more general object as an argument in one of my functions and then change the behavior within the function based on its type.

更多推荐

使用C#进行转换

本文发布于:2023-11-07 06:13:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565752.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!