문제

Can I delete the old rectangle which I have drawn and draw a new rectangle?

private void panel1_MouseClick(object sender, MouseEventArgs e)
{
        Graphics g = this.panel1.CreateGraphics();
        Pen pen = new Pen(Color.Black, 2);

        g.DrawRectangle(pen, 100,100, 100, 200);
        g.dispose();
}

올바른 솔루션이 없습니다

다른 팁

작업 목록에 첨부 된 ItemUpdated 처리기가있는 이벤트 수신자가가는 방법입니다.

여기 링크이벤트 수신기가 새로운 경우 시작할 MSDN을 시작하십시오.

This is usually done by maintaining a collection of objects you want drawn. The mouse click should update this collection and then tell the window (or the affect region) to refresh. This has the enormous advantage of preserving whatever you've drawn if the window is moved off-screen, hidden behind other windows, minimized, etc.

For a rudimentary solution, create a hierarchy of drawable shape types derived from a common abstract Shape class, and use, e.g., a List for the collection. The base Shape class will have an abstract Draw method that the derived classes override.

For a more industrial-strength solution, look around for 2-D scene graphs.

One can use Graphics.Save() and Graphics.Restore(state) methods for that. For example:

private void SaveRestore2(PaintEventArgs e)
{
    // Translate transformation matrix.
    e.Graphics.TranslateTransform(100, 0);

    // Save translated graphics state.
    GraphicsState transState = e.Graphics.Save();

    // Reset transformation matrix to identity and fill rectangle.
    e.Graphics.ResetTransform();
    e.Graphics.FillRectangle(new SolidBrush(Color.Red), 0, 0, 100, 100);

    // Restore graphics state to translated state and fill second

    // rectangle.
    e.Graphics.Restore(transState);
    e.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 100, 100);
}

http://msdn.microsoft.com/en-us/library/system.drawing.graphics.restore.aspx

나는 며칠 동안 이것을 싸우고있었습니다.사용자 정의 편집 양식에는 70 개의 필드가 70 개가 있습니다. 이는 생성 된 첨부 파일, 수정, 수정, 만들어지고 생성됩니다.나는 SP2010에 있지만이 문제는 2013 년에도 있습니다. Book SharePoint Designer 2010은 Hughes, P1329에 의해 풀어졌습니다.

엔터프라이즈 SharePoint 라이센스가있는 경우 InfoPath에서 양식을 편집 하여이 작업을 중심으로 가져올 수 있습니다.실패한 경우, 양식 필드의 수를 어떻게 줄일 수 있는지 확인하십시오.예를 들어, 우리의 경우 항목 생성에 입력 한 일부 정보가 있지만 그 후에 변경되어서는 안됩니다. 그래서 편집 양식에 필요하지 않습니다.우리는 여전히 디스플레이 양식에 가질 수 있습니다.

다른 옵션은 다른 역할을 가진 사용자를위한 여러 편집 양식을 가지고 있으며 따라서 모든 필드를 한 번에 한 번 볼 필요가 없습니다.

희망이 도움이됩니다.

Instead of calling g.DrawRectangle(pen, 100,100, 100, 200); , maintain the rectangle as a object which will be drawn by the graphics object. Each time you will update this rectangle object with new one and graphics object will draw the new one.

The refresh should clear the old rectangle and graphics will draw the new one.

IIS에 SMTP를 설치하면 드롭 박스가 자동으로 생성됩니다.

Open IIS Manager -> 기본 SMTP 가상 서버 -> 도메인 -> mossserver.domain.com -> 속성.

DROP Directory 위치를 확인하고 모든 전자 메일은 SharePoint 타이머 서비스가 픽업 할 때까지 모든 전자 메일을 저장할 수있는 기본 위치가 "C : \ inetpub \ mailroot \ drop"입니다.SharePoint Timer 서비스는이 폴더를 5 분마다 확인합니다 (기본값).메일을 가져 오는 타이머 작업은 약 5 분마다 실행되므로 이메일이 오래 앉지 않아야합니다

"Microsoft SharePoint Foundation 들어오는 전자 메일"서비스는 드롭 폴더에서 전자 메일을 선택하고 전자 메일의 X-SenderX-Receiver 헤더를 사용하여 필요한 위치로 전송합니다.이 메일에서 SMTP 서비스를 사용하는 경우 자동으로 추가됩니다.창문.

I think using DrawReversibleFrame is the right solution. The first call draw the rectangle, the second call undraw it and so on.

Here is a sample code, a clic on the button will make the rectangle appear/disapper.

Rectangle pRect = new Rectangle(10, 10, 20, 20);
private void rect_Click(object sender, EventArgs e)
{
  ControlPaint.DrawReversibleFrame(pRect, this.BackColor, FrameStyle.Thick);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top