.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to let the screen not flesh?

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
swaywood
820 Views, 8 Replies

how to let the screen not flesh?

Hi,all:

I just make a cad.net program with a simple winform.

when i hide the form or dispose the form, the autocad creen will flesh one time.

i saw the forms in autocad application not flesh when colse or hide them.

Is there any method let the form display silently?

 

best regards

swaywood

8 REPLIES 8
Message 2 of 9
swaywood
in reply to: swaywood

anyone met this?

i know this question is not a cad question at all, it is a c# question, but any one can help me?

best regards

swaywood

Message 3 of 9
swaywood
in reply to: swaywood

sorry, the word 'flesh' i post in this message is 'flash', means '

  • Splash;
  • splash screen;
  • Flash screen;
  • Dodges the screen'
Message 4 of 9
Anonymous
in reply to: swaywood

Is your form Modal or Modeless? Also please post your code.
Message 5 of 9
swaywood
in reply to: Anonymous

hi,conormccartney:

thank you for your reply.

i just make one simple sample, which can only select a point.

the following is the code, and attached is the whole solustion file.

when i click the button, the screen will flash

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;

namespace ClassLibrary2
{
    public class Class1
    {
        [CommandMethod("test")]
        public void test()
        {
            Form1 frm = new Form1();
            Application.ShowModalDialog(frm);
        }
    }
}

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;

namespace ClassLibrary2
{
    public partial class Form1 : Form
    {
        Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
            PromptPointOptions ppo = new PromptPointOptions("\nplease select a point:");
            PromptPointResult ppr = ed.GetPoint(ppo);
            if (ppr.Status == PromptStatus.OK)
            {
                this.Show();
                label1.Text = ppr.Value.ToString();
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            label1.Text = "load";
        }
    }
}

 

 

Message 6 of 9
Anonymous
in reply to: swaywood

Hrmm well my first thought was having to do with modeless forms, but that's not the issue. my second thought is move the Me.Show() statement to right before tne End Sub. Other then that, I got nothing 🙂
Message 7 of 9
swaywood
in reply to: Anonymous

hi,conormccartney:

thank you so much, i'll have a try.

Message 8 of 9
Balaji_Ram
in reply to: swaywood

Hi Swaywood,

 

You can also try the "EditorUserInteraction" :

 

http://adndevblog.typepad.com/autocad/2012/05/taking-mouse-inputs-from-a-modal-dialog-box.html

 

Regards,

Balaji



Balaji
Developer Technical Services
Autodesk Developer Network

Message 9 of 9
swaywood
in reply to: Balaji_Ram

Thank you all, both of the methods work well.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost