Author Topic: PromptStringOptions allow spaces?  (Read 2889 times)

0 Members and 1 Guest are viewing this topic.

MDONUT12

  • Guest
PromptStringOptions allow spaces?
« on: February 07, 2007, 11:32:54 AM »
I'm wondering if someone can help me out here. I got this code below I think in the Labs or maybe a post here on this forum. Well I'm trying to allow the user to enter spaces when they type in the response to me string. I found ".allowspaces = true" But when I append it to the end of the PrompStringOptions I get an invalid sytax.

So can someone help me adjust my code to allow strings.



Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor

        Dim pr2 As PromptStringOptions = New PromptStringOptions("Type your Instant Message: ")
        Dim res2 As PromptResult = ed.GetString(pr2)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: PromptStringOptions allow spaces?
« Reply #1 on: February 07, 2007, 03:04:14 PM »
Have you tried something like ..

 
Code: [Select]
     public void Test()
      {
         Editor ed = AcadApp.DocumentManager.MdiActiveDocument.Editor;

         PromptStringOptions ops = new PromptStringOptions("\nLayer name: ");
         ops.AllowSpaces = true;

         PromptResult res = ed.GetString(ops);

         if( res.Status == PromptStatus.OK && res.StringResult != string.Empty )
         {
//. . . . . .
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MDONUT12

  • Guest
Re: PromptStringOptions allow spaces?
« Reply #2 on: February 07, 2007, 03:15:01 PM »
Have you tried something like ..

 
Code: [Select]
     public void Test()
      {
         Editor ed = AcadApp.DocumentManager.MdiActiveDocument.Editor;

         PromptStringOptions ops = new PromptStringOptions("\nLayer name: ");
         ops.AllowSpaces = true;

         PromptResult res = ed.GetString(ops);

         if( res.Status == PromptStatus.OK && res.StringResult != string.Empty )
         {
//. . . . . .

I swear i tried this before, as I found it in another post. But I must of did it wrong. Anyways this did the trick thank you very much!!