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
S

shamsteady

@shamsteady
About
Posts
35
Topics
19
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Get system time
    S shamsteady

    It said GetSystemTime() is undeclared. Am i missing something?

    C / C++ / MFC question

  • Get system time
    S shamsteady

    How can i get the system time and display it?

    C / C++ / MFC question

  • get system time
    S shamsteady

    Thanks for the information

    Managed C++/CLI question

  • get system time
    S shamsteady

    How can i get the system time?

    Managed C++/CLI question

  • Reorder
    S shamsteady

    I had write this code to do drag and drop at window form panel. How can i do the reorder panel because this code only to do drag and drop? using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; namespace CMSMS { public class mypanel:System.Windows.Forms.Panel { private bool isDragging=false; public int x,y; protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown (e); isDragging = true; x = e.X; y = e.Y; } protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp (e); isDragging = false; } protected override void OnMouseMove(MouseEventArgs e) { if (isDragging == true) { this.Left= e.X + this.Left - x; this.Top = e.Y + this.Top - y; } } } }

    C# question graphics

  • Create chart
    S shamsteady

    I'm doing this coding and its running properly. This coding is to create a chart that can be drag and drop. I create the Panel as the bar. The panel will be generated depend on input. But the problem is the Panel is generated too many as it like there is nonstop loop. Can anyone solve this problem...plz using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; namespace CMSMS { public class mypanel:System.Windows.Forms.Panel { private bool isDragging=false; public int x,y; protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown (e); isDragging = true; x = e.X; y = e.Y; } protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp (e); isDragging = false; } protected override void OnMouseMove(MouseEventArgs e) { if (isDragging == true) { this.Left= e.X + this.Left - x; this.Top = e.Y + this.Top - y; } } } } using System; using System.Drawing; using System.Drawing.Imaging; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace CMSMS { /// /// Summary description for GranttChart. /// public class GranttChart : System.Windows.Forms.Form { ... private mypanel [] bar = new mypanel[60]; ... public void GenerateGranttChart() { GenerateChart(); } private void GenerateChart() { for (int i = 0; i < 10; i++) { int xPosition = 100; for (index = 0; index < 10; index++) { for (int j = 0; j < 10; j++) { DrawPanel( xPosition, yPosition,j,brush, length); xPosition += length; } yPosition -= range; } } } private void DrawPanel(int X,int Y,int j,SolidBrush brush, int l) { bar[j]=new mypanel(); this.bar[j].Size = new Size(l,20); this.bar[j].BackColor = brush.Color; this.bar[j].Location = new Point(X,Y); } rotected override void OnPaint(PaintEventArgs e) { ... GenerateChart(); ... }

    C#

  • Override
    S shamsteady

    I try to do that but get error while compiling. Am i missing something?

    C#

  • Override
    S shamsteady

    Can i do like this? Is this allowed in C#? protected override void OnPaint(PaintEventArgs e) { ... ... } private void GenerateChart() { ... OnPaint(PaintEventArgs e) ... }

    C#

  • Generate random number
    S shamsteady

    Thank you very much..

    C#

  • Generate random number
    S shamsteady

    How can i generate random number in C#?

    C#

  • Generate Panel
    S shamsteady

    I had write this code for (int i = 0; i < totalEquipment; i++) try { for (int j = 0; j < sEquip[index].index; j++) { try { ... bar[j].Size = new Size(length,20); bar[j].BackColor = System.Drawing.Color.Blue; bar[j].Location = new Point(xPosition,yPosition); this.Controls.Add(bar[j]); ... } catch (Exception ex) { throw new Exception(ex.Message + " " + ex.StackTrace); } finally { xPosition += length; } } } catch (Exception ex) { throw new Exception(ex.Message + " " + ex.StackTrace); } finally { yPosition -= range; } } } The problem is this part which it keep add panel to window form without stoping like non stop looping. How can i stop this error? try { ... bar[j].Size = new Size(length,20); bar[j].BackColor = System.Drawing.Color.Blue; bar[j].Location = new Point(xPosition,yPosition); this.Controls.Add(bar[j]); ... }

    C#

  • Add panel
    S shamsteady

    Thanks...

    C#

  • Add panel
    S shamsteady

    Im trying to add panel in window form by using this method. public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.Panel mypanel; private void InitializeComponent() { ... this.mypanel = new System.Windows.Forms.Panel(); ... } ... ... this.Controls.Add(this.mypanel); Is there other way to display panel besides using "this.Controls.Add(this.mypanel);" method?

    C#

  • Loop
    S shamsteady

    The code contain an array of panel that will be add to window form. It will be display according to the number of input. The problem is the panel will be display but it keep blinking during runtime meaning that it generate too many panel...

    C#

  • Loop
    S shamsteady

    I had write this code for (int i = 0; i < totalEquipment; i++) try { for (int j = 0; j < sEquip[index].index; j++) { try { ... bar[j].Size = new Size(length,20); bar[j].BackColor = System.Drawing.Color.Blue; bar[j].Location = new Point(xPosition,yPosition); this.Controls.Add(bar[j]); ... } catch (Exception ex) { throw new Exception(ex.Message + " " + ex.StackTrace); } finally { xPosition += length; } } } catch (Exception ex) { throw new Exception(ex.Message + " " + ex.StackTrace); } finally { yPosition -= range; } } } The problem is this part which it keep add panel to window form without stoping like non stop looping. How can i stop this error? try { ... bar[j].Size = new Size(length,20); bar[j].BackColor = System.Drawing.Color.Blue; bar[j].Location = new Point(xPosition,yPosition); this.Controls.Add(bar[j]); ... }

    C#

  • Array
    S shamsteady

    Thanks for the useful information

    C#

  • Array
    S shamsteady

    I declare "private System.Windows.Forms.Panel mypanel;" in window form to get a panel name my panel. Can i declare "System.Windows.Forms.Panel [] mypanel;" to get an array of panel because i want to generate couple of mypanel during runtime...

    C#

  • Class
    S shamsteady

    Thanks. This really works...

    C#

  • Error
    S shamsteady

    How to access the left and top property's through the sender object? Can you give example. i am new to c# and need guide..

    C#

  • Error
    S shamsteady

    Actually it has that control but it need to be declared. But when i made it into class, but in class it can't be done.

    C#
  • Login

  • Don't have an account? Register

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