如何使用c#在幻灯片中的(副标题)占位符中添加文本框 [英] how to add a textbox within a (subtitle)placeholder in a slide using c#

查看:411
本文介绍了如何使用c#在幻灯片中的(副标题)占位符中添加文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用VS2013 powerpoint插件创建Agenda幻灯片(即创建一张包含活动演示文稿所有标题的幻灯片)。



我的问题是如何在幻灯片中的副标题占位符内创建文本框。

例如,在幻灯片中我们有标题和副标题的占位符 - 在标题我正在添加文本,

presentation.Slides [1] .Shapes.Title.TextFrame.TextRange.Text =议程;



我可以添加一个文本框,例如

PowerPoint.Shape textBox1 = presentation.Slides [1] .Shapes.AddTextbox(

Office.MsoTextOrientation.msoTextOrientationHorizo​​ntal, 0,0,600,50);

textBox1.TextFrame.TextRange.InsertAfter(presentation_text);



这里,presentation_text包含全部活动演示文稿的标题。



但问题是我希望文本框出现在字幕占位符或部分内。



请帮帮我:(

先谢谢!!!

解决方案

< blockquote> txtbox mytxtbx = new txtbox();

mytxtbx.Text =在此输入文字:;

myTxtbx.OnFocus + = OnFocus.EventHandle(RemoveText);

myTxtbx.LoseFocus + = LoseFocus.EventHandle(AddText);



public RemoveText(object sender,EventArgs e)

{

myTxtbx.Text =;

}



public AddText(object sender, EventArgs e)

{

if(myTxtbx.Text ==)

myTxtbx.Text =在这里输入文字...... ;

}


Hi,
I am using VS2013 powerpoint Add-in for creating Agenda slide(that is, creating a slide with all the titles of an active presentation).

My question is how to create a textbox inside the placeholder of subtitle in a slide.
That is, for example, in a slide we have placeholders for title and subtitle- in title i am adding text as,
presentation.Slides[1].Shapes.Title.TextFrame.TextRange.Text = "Agenda";

And I am able to add a textbox like
PowerPoint.Shape textBox1 = presentation.Slides[1].Shapes.AddTextbox(
Office.MsoTextOrientation.msoTextOrientationHorizontal, 0, 0, 600, 50);
textBox1.TextFrame.TextRange.InsertAfter(presentation_text);

Here, the presentation_text contains all the titles of the active presentation.

But the thing is i want the text box to appear inside subtitle placeholder or section.

Please help me:(
Thanks in Advance!!!

解决方案

txtbox mytxtbx= new txtbox();
mytxtbx.Text="Enter the text here:";
myTxtbx.OnFocus += OnFocus.EventHandle(RemoveText);
myTxtbx.LoseFocus += LoseFocus.EventHandle(AddText);

public RemoveText(object sender, EventArgs e)
{
myTxtbx.Text = "";
}

public AddText(object sender, EventArgs e)
{
if(myTxtbx.Text == "")
myTxtbx.Text = "Enter text here...";
}


这篇关于如何使用c#在幻灯片中的(副标题)占位符中添加文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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