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
T

t800t8

@t800t8
About
Posts
26
Topics
13
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How can get WAVE file length?
    T t800t8

    I have a WAVE file and I want to know how much time that file can be played. How can I do it? I tried to use OpenNetCF but its WaveFormat2 doesn't help. I'm working on Windows Mobile 5 and .NET Compact Framework 2.0. Thanks

    I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    Mobile question csharp help

  • ComboBox bug?
    T t800t8

    It's a bug. I have a list contains several items of Tag(int id, string name). I use "id" as ValueMember and "name" as DisplayMember. If the first item has name is an empty string, the problem will appear. When you click the arrow, seems M$ implemented to select text value to get the index. If you have an empty string, it cannot select anything and the returned index will be -1.

    I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# help question

  • ComboBox bug?
    T t800t8

    I have a combo box whose items are load from a List (List is not empty). I already set SelectedIndex = 0 to choose the first item in code. But at runtime, when I click the arrow, drop down list appear and I don't select any item, SelectedIndex will be set to -1. If I select an item, SelectedIndex will be other than -1. I think SelectedIndex should be 0 even I click the arrow and don't select any item. Is there any body has same problem?

    I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# help question

  • How to disable maximize/restore button of a MDI child form
    T t800t8

    I found the answer myself. First, set maximize the child form in Form load event. Second, set ControlBox of the child form to be False. I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# question tutorial

  • How to disable maximize/restore button of a MDI child form
    T t800t8

    I want to maximize MDI child form and also disable maximize button of it. How can I do that? Thanks I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# question tutorial

  • How to turn off executing Load event at design time feature?
    T t800t8

    I told you the reason why I think this feature is stupid. But you, nothing. I just want to give you an opportunity to defend your idea. And if you cannot defend it, I will keep my idea until I find it fail. Don't wasting my time! ;-) I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# question html visual-studio com design

  • How to turn off executing Load event at design time feature?
    T t800t8

    Can you show me the correct way to write a component? I want to see if it is correct or not. ;-) I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# question html visual-studio com design

  • How to turn off executing Load event at design time feature?
    T t800t8

    Render? Did you forget InitializeComponent() method in constructor? I just have some questions for you. + Do you like it shows a message like in my example at design time? + Do you like to get an error message and can not design your form when you only want to load the picture at runtime like this button1.Image = Image.FromFile(Constant.IMAGES_DIRECTORY_PATH + "Back.jpg"); ? These only some simple cases. If you like them, this stupid feature is for you! I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# question html visual-studio com design

  • How to turn off executing Load event at design time feature?
    T t800t8

    This code, it works. Thanks! :-) private void BaseForm_Load(object sender, System.EventArgs e){ if (!base.DesignMode){ MessageBox.Show("Hello, World!"); } } I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# question html visual-studio com design

  • How to turn off executing Load event at design time feature?
    T t800t8

    I try to write a class that extends Form like that: public partial class BaseForm : Form { public BaseForm() { InitializeComponent(); } private void BaseForm_Load(object sender, System.EventArgs e) { MessageBox.Show("Hello, World!"); } } And then I write a class that extends class BaseForm public partial class MyForm : BaseForm { public MyForm() { InitializeComponent(); } } I rebuild project and open MyForm to design, it suddenly appears "Hello, World!" message box. I think it is a stupid feature in VS 2005 (I didn't check it in VS 2002, 2003 yet). How can I turn off this feature? http://t800t8.blogspot.com/2006/02/thc-thi-s-kin-load-khi-ang-design-form.html I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing -- modified at 19:58 Monday 20th February, 2006

    C# question html visual-studio com design

  • How to implement IEnumerator with generics?
    T t800t8

    Oop, I fixed it myself. Thanks anyway! using System.Collections; using System.Collections.Generic; namespace TryCollection.PositionEngine { class Tag : IEnumerable { #region Declare variables for internal use private List pointList = null; #endregion #region Declare variables for properties private string name; #endregion #region Constructors public Tag(string name) { this.name = name; pointList = new List(); } #endregion #region Properties public string Name { get { return name; } } #endregion #region Methods public void Add(Point point) { pointList.Add(point); } public IEnumerator GetEnumerator() { return pointList.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } #endregion } } I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# help question tutorial

  • How to implement IEnumerator with generics?
    T t800t8

    I implement my class like this using System.Collections; using System.Collections.Generic; namespace TryCollection.PositionEngine { class Tag : IEnumerable { #region Declare variables for internal use private List pointList = null; #endregion #region Declare variables for properties private string name; #endregion #region Constructors public Tag(string name) { this.name = name; pointList = new List(); } #endregion #region Properties public string Name { get { return name; } } #endregion #region Methods public void Add(Point point) { pointList.Add(point); } public IEnumerator GetEnumerator() { return pointList.GetEnumerator(); } #endregion } } but when I compile it, it shows me an error that 'TryCollection.PositionEngine.Tag' does not implement interface member 'System.Collections.IEnumerable.GetEnumerator()'. 'TryCollection.PositionEngine.Tag.GetEnumerator()' is either static, not public, or has the wrong return type. How can I implement System.Collections.IEnumerable.GetEnumerator() while I already have 'System.Collections.Generic.IEnumerable.GetEnumerator()? Help me! Thanks! I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing -- modified at 3:42 Thursday 26th January, 2006

    C# help question tutorial

  • Overwrite an image after unload it from a picture box control
    T t800t8

    I will try as your recommendation. Thank you! I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# question

  • Overwrite an image after unload it from a picture box control
    T t800t8

    Extractly! But I don't use Bitmap.FromFile, I used pictureBox.Load(). I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# question

  • Overwrite an image after unload it from a picture box control
    T t800t8

    Maybe my description has some confusions for you. I don't want to load another image to the pictrue box, I want my program can overwrite the image which I just have unload from the picture box. I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# question

  • Overwrite an image after unload it from a picture box control
    T t800t8

    After I unloaded an image from a picture box like that: if (pictureBox.Image != null){ pictureBox.Image.Dispose(); pictureBox.Image = null; } but when the application is still running, I cannot overwrite this image. How can overwrite it while application is still running? Thanks a lot! I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# question

  • How to unload image in a PictureBox control
    T t800t8

    It works! Thanks again! :-) I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# question tutorial

  • How to unload image in a PictureBox control
    T t800t8

    I loaded an image into a PictureBox control. But next time I want to unload it. How can I do that? Thanks! I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# question tutorial

  • Hit testing problem
    T t800t8

    Maybe my description has some confusion for you. Here is my code:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;

    namespace RFCart
    {
    public partial class Main : Form
    {

    		// picImage is a PictureBox control
    		
    			private int drawMode;
    			private bool mouseIsInShelf;
    			
    			private Shelf currentShelf;
    			private ShelfArray shelfs = new ShelfArray();
    			
    			private void Main\_Load(object sender, EventArgs e)
    			{
    			
    			    drawMode = Constant.SHELF\_MODE;
    			
    			}
    			        
    			private void picImage\_MouseDown(object sender, MouseEventArgs e)
    			{
    			
    			    switch (e.Button)
    			    {
    			
    			        case MouseButtons.Left:
    			
    			            Point mousePoint = new Point(e.X, e.Y);
    			
    									if (drawMode == Constant.SHELF\_MODE)
    			            {
    			
    			                // Catch top-left point
    			                currentShelf = new Shelf();
    			                currentShelf.StartPoint = mousePoint;
    			
    			            }
    			
    			            break;
    			
    			    }
    			
    			}
    			
    			private void picImage\_MouseUp(object sender, MouseEventArgs e)
    			{
    			
    			    switch (e.Button)
    			    {
    			
    			        case MouseButtons.Left:
    			
    			            Point mousePoint = new Point(e.X, e.Y);
    			
    									if (drawMode == Constant.SHELF\_MODE)
    			            {
    			
    			                // Catch bottom-right point
    			                currentShelf.EndPoint = mousePoint;
    			
    			                // Add current shelf to array
    			                shelfs.Add(currentShelf);
    			
    			                // Force to re-draw all shelfs
    			                picImage.Invalidate();
    			
    			            }
    			
    			            break;
    			
    			    }
    			
    			}
    			
    			private void picImage\_MouseMove(object sender, MouseEventArgs e)
    			{
    			
    			    Point mousePoint = new Point(e.X, e.Y);
    			
    			    foreach (Shelf shelf in shelfs)
    			    {
    			
    			        if (shelf.Contains(mousePoint))
    			        {
    			            mouseIsInShelf = true;
    			            break;
    			        }
    			        else
    			        {
    			            mouseIsInShelf = false;
    			        }
    			
    			    }
    			    
    			}
    			
    			private void picImage\_Paint(object sender, PaintEventArgs e)
    			{
    			
    			    foreach (Shelf shelf in shelfs)
    			    {
    			
    			        shelf.Draw(e.Graphics,
    
    C# help data-structures testing beta-testing question

  • Hit testing problem
    T t800t8

    I need to write a program which can draw rectangle by mouse. User can draw a rectangle by click left mouse button and drag mouse, when user release left mouse button, rectangle will be drawn. I can draw rectangle, but now I want to check when I move mouse, program can show me the mouse is inside a rectangle or not. I use an RectangleArray which inherits from CollectionBase to store all drawn rectangle. In mouse move method, I loop through this array and use Contains method of Rectangle class to check the mouse inside or not. But I don't understand while I only can check the position of mouse if it is inside the first rectangle I drawn (label4 only change value when I move the mouse inside the first rectangle). If I show a message box, label4 can change its value when I move the mouse inside any rectangle.

    private void picImage_MouseMove(object sender, MouseEventArgs e)
    {

    Point mousePoint = new Point(e.X, e.Y);
    
        foreach (Rectangle rect in rects)
        {
    
                if (rect.Contains(mousePoint))
                {
               		label4.Text = "In rect";
               		//MessageBox.Show(label4.Text);
               		break;
            }
               	else
               	{
               		label4.Text = "Not in rect";
               	}
    
       	}
    

    }

    Can anybody help me? Thanks a lot! I'm ... a fan of Manchester United a fan of Ozzy Osbourne a King of Nothing

    C# help data-structures testing beta-testing question
  • Login

  • Don't have an account? Register

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