Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. UI Delay [modified]

UI Delay [modified]

Scheduled Pinned Locked Moved C#
graphicshelpcsharphtmllinq
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    viciouskinid
    wrote on last edited by
    #1

    I am having some trouble when I try to load some UI. If you can download my code http://www.2shared.com/file/6531405/908ada48/Delay.html[^] and then click on the new file icon the graphics will show. I have 2 issues. firstly the panels, treview and property grids have a small but noticeable delay when they are being shown. You can see the controls incomplete as they are being drawn, it looks really messy. Is there a way to remove this delay? Second, as you can see in the code I have a border around my UI. I dont think just drawing it is the best way to do it because when I resize the main window the refreshing causes the line to flicker. I have resulted in just turning it off when resizing. I think that it is possible to make a custom panel control and have this border drawn onto that. If so, and if it will solve the problem, can someone help me create this control. Thanks As requested my code is below.

    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 MyShapesCollection;

    namespace WindowsFormsApplication1
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    panel1.Visible = false;
    }

        private void toolStripButtonNew\_Click(object sender, EventArgs e)
        {
    
    
            this.SuspendLayout();
            panel1.Visible = true;
            Paint1();
            this.ResumeLayout();
        }
    
        private void Form1\_Load(object sender, EventArgs e)
        {
    
        }
    
        private void panelMB\_Paint(object sender, PaintEventArgs e)
        {
            int \_ShadowDistance = -11;
    
            Shapes shapes = new Shapes();
            Color Main = Color.FromArgb(105, 161, 191);
            Color Border = Color.FromArgb(210, 230, 250);
            Color Shine = Color.White;
            Color Centre = Color.White;
    
    
    
            shapes.Draw.ShadowedBorder(panelMB, e, \_ShadowDistance, Main, Shine, Centre, Border);
        }
    
        private void toolStripButtonOpen\_Click(object sender, EventArgs e)
        {
            panel1.Visible = false;
        }
    
        private void toolStripButtonSave\_Click(object sender, EventArgs
    
    H 1 Reply Last reply
    0
    • V viciouskinid

      I am having some trouble when I try to load some UI. If you can download my code http://www.2shared.com/file/6531405/908ada48/Delay.html[^] and then click on the new file icon the graphics will show. I have 2 issues. firstly the panels, treview and property grids have a small but noticeable delay when they are being shown. You can see the controls incomplete as they are being drawn, it looks really messy. Is there a way to remove this delay? Second, as you can see in the code I have a border around my UI. I dont think just drawing it is the best way to do it because when I resize the main window the refreshing causes the line to flicker. I have resulted in just turning it off when resizing. I think that it is possible to make a custom panel control and have this border drawn onto that. If so, and if it will solve the problem, can someone help me create this control. Thanks As requested my code is below.

      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 MyShapesCollection;

      namespace WindowsFormsApplication1
      {
      public partial class Form1 : Form
      {
      public Form1()
      {
      InitializeComponent();
      panel1.Visible = false;
      }

          private void toolStripButtonNew\_Click(object sender, EventArgs e)
          {
      
      
              this.SuspendLayout();
              panel1.Visible = true;
              Paint1();
              this.ResumeLayout();
          }
      
          private void Form1\_Load(object sender, EventArgs e)
          {
      
          }
      
          private void panelMB\_Paint(object sender, PaintEventArgs e)
          {
              int \_ShadowDistance = -11;
      
              Shapes shapes = new Shapes();
              Color Main = Color.FromArgb(105, 161, 191);
              Color Border = Color.FromArgb(210, 230, 250);
              Color Shine = Color.White;
              Color Centre = Color.White;
      
      
      
              shapes.Draw.ShadowedBorder(panelMB, e, \_ShadowDistance, Main, Shine, Centre, Border);
          }
      
          private void toolStripButtonOpen\_Click(object sender, EventArgs e)
          {
              panel1.Visible = false;
          }
      
          private void toolStripButtonSave\_Click(object sender, EventArgs
      
      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #2

      You might get lucky, but no one in their right mind is going to download stuff from someone they don't know. You would be better to edit your post and include the section of code giving the problem. Don't forget to use the 'code block' widget, or put in the pre tags manually.

      Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

      L 1 Reply Last reply
      0
      • H Henry Minute

        You might get lucky, but no one in their right mind is going to download stuff from someone they don't know. You would be better to edit your post and include the section of code giving the problem. Don't forget to use the 'code block' widget, or put in the pre tags manually.

        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Henry Minute wrote:

        no one in their right mind is going to download stuff from someone they don't know

        That sure stopped me. :-D

        Luc Pattyn [Forum Guidelines] [My Articles]


        DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


        M 1 Reply Last reply
        0
        • L Luc Pattyn

          Henry Minute wrote:

          no one in their right mind is going to download stuff from someone they don't know

          That sure stopped me. :-D

          Luc Pattyn [Forum Guidelines] [My Articles]


          DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


          M Offline
          M Offline
          MumbleB
          wrote on last edited by
          #4

          The length of the modifed post stopped me dead in my tracks!!!

          Excellence is doing ordinary things extraordinarily well.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups