<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Changing InfoPath control background color via IOLECommand</title><link>https://www.infopathdev.com:443/forums/thread/23726.aspx</link><pubDate>Mon, 15 Oct 2007 19:50:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23726</guid><dc:creator>davehacker</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23726.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=23726</wfw:commentRss><description>&lt;p&gt;I just received word (although not &amp;#39;official&amp;#39; word), that hosting the infopath controls in design mode is not supported.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;This confuses me because the sample code referenced earlier looks like it is setup to design (edit) the form.&amp;nbsp; Oh well.&lt;/p&gt;</description></item><item><title>Re: Changing InfoPath control background color via IOLECommand</title><link>https://www.infopathdev.com:443/forums/thread/23668.aspx</link><pubDate>Thu, 11 Oct 2007 15:13:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23668</guid><dc:creator>davehacker</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23668.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=23668</wfw:commentRss><description>&lt;p&gt;Sorry, not much help here.&amp;nbsp; I have the exact same problem.&amp;nbsp; I tried both the C# and C++ examples and all the form design\customization options are disabled.&amp;nbsp; With the C++ project (HostIP), I get the following error:&lt;/p&gt;
&lt;p&gt;---------------------------&lt;br /&gt;Command cannot be performed at this time, it is either not supported or disabled&lt;br /&gt;---------------------------&lt;br /&gt;OK&amp;nbsp;&amp;nbsp; &lt;br /&gt;---------------------------&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;This seems to be the same behavior that you get when you open a form in InfoPath.&amp;nbsp; You can&amp;#39;t edit the form.&amp;nbsp; However, from within InfoPath all I need to do is click the &amp;#39;Design this Form&amp;#39; button and I can then make changes.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Does anybody know how to embed an&amp;nbsp;EDITABLE InfoPath control from within a Windows Application?&amp;nbsp; Thanks in advance for any tips!&amp;nbsp; I&amp;#39;ll post if I find anything out...&lt;/p&gt;</description></item><item><title>Changing InfoPath control background color via IOLECommand</title><link>https://www.infopathdev.com:443/forums/thread/23104.aspx</link><pubDate>Mon, 17 Sep 2007 14:26:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23104</guid><dc:creator>MSolve1</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23104.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=23104</wfw:commentRss><description>&lt;p&gt;I have an InfoPath control hosted in Winforms app. My problem is that I need to change the background color to match the &amp;#39;skin&amp;#39; of the hosting form. To my delight, there was this Microsoft sample (&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=F65C20DF-ADC2-446A-8FBC-D7C5ED5DD83F&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=F65C20DF-ADC2-446A-8FBC-D7C5ED5DD83F&amp;amp;displaylang=en&lt;/a&gt;) that I&amp;#39;ve downloaded that seem to include code to do just that. Unfortunately, (you guessed it right) it doesn&amp;#39;t work. Instead, I&amp;#39;m getting a DRAGDROP_E_NOTREGISTERED or DRAGDROP_E_ALREADYREGISTERED exception depending on which form or control (e.g. NotifyHost call @ XDocument.OnLoad) event I&amp;#39;ve issued the command to set the BackgroundColor property.&lt;/p&gt;Here&amp;#39;s&amp;nbsp;the code snippet:&amp;nbsp;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;span style="mso-tab-count:2;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;span style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;&lt;font face="Arial" color="#000000"&gt;public Color BackgroundColor&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&lt;/font&gt;&lt;font face="Arial" color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;set&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UInt32 vaIn;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;vaIn = Convert.ToUInt32(System.Drawing.ColorTranslator.ToOle(value));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch (Exception ex)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new HostedException(&amp;quot;An error occurred while attempting to set the background color&amp;quot;, ex);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetSelectedTextBackgroundColor, vaIn));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;public object ExecuteCommand(FormControlCommandIds.CommandIds commandId, object vaIn)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//remember the last command executed&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;lastCommandExecuted = commandId.ToString();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//indicates to Exec call to do the default option&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;const int EXECUTE_OPTION_DO_DEFAULT = 0;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;//holds the return result&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;object vaOut = null;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Get the commandTarget from the control&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;IOleCommandTarget commandTarget = _infoPathControl.GetOcx() as IOleCommandTarget;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;commandTarget.Exec(ref FormControlCommandIds.CommandGroup, Convert.ToUInt16(commandId,CultureInfo.CurrentCulture),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;EXECUTE_OPTION_DO_DEFAULT, ref vaIn, ref vaOut);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return vaOut;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch (Exception ex)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new HostedException(&amp;quot;An error occurred while executing command &amp;quot; + commandId.ToString(), ex);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;What puzzles me is that the sample application contains lots of formatting options that are disabled by default. I have no idea how to enable them and there&amp;#39;s zero documentation on how it is suppose to work.&lt;/p&gt;
&lt;p&gt;Any help would be greatly appreciated.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Menard&lt;br /&gt;&lt;span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;</description></item></channel></rss>