ShowingPlaceholderText not working?

  • Thread starter Jens Gyldenkærne Clausen
  • Start date
J

Jens Gyldenkærne Clausen

Hi group. I'm trying to program a Word 2007 Template with
ContentControls. On field exit (the Exiting event) I would like to
check if the user has changed the original value - and for this purpose
I thought the ShowingPlaceHolderText property would be just right.
However, it doesn't work as expected - no matter what I try, the
ShowingPlaceholderText property always returns false.

Some example code:

private void ThisDocument_Startup(object sender, System.EventArgs e)
{
myObj.PlaceholderText = myObj.Text;
bool a = stilling1.ShowingPlaceholderText;
bool b = (stilling1.Text == stilling1.PlaceholderText);
}

When debugging I get a==false and b==true - but I haven't got a clue of
why this is happening. I can of course just use the test behind bool b
to perform the check, but I would like to know if I'm missing something
or if the ShowingPlaceholderText property just isn't working correctly.
 
J

Jens Gyldenkærne Clausen

Jens said:
private void ThisDocument_Startup(object sender, System.EventArgs e)
{
myObj.PlaceholderText = myObj.Text;
bool a = stilling1.ShowingPlaceholderText;
bool b = (stilling1.Text == stilling1.PlaceholderText);
}

Whoops - I forgot to change the variable name in the two last lines of
the example - should have been "myObj" all the way (in the real code it
is "stilling1" in all three lines).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top