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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
D

dennis_max27

@dennis_max27
About
Posts
14
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Runtime ToFront toBack?
    D dennis_max27

    Sombody?

    C# graphics csharp linq design help

  • Runtime ToFront toBack?
    D dennis_max27

    Yes im trying some things do will say when it is owkring here. Now waiting for somebody else his help. Thanks!

    C# graphics csharp linq design help

  • Runtime ToFront toBack?
    D dennis_max27

    II've used this code now all is working BUT!: Here is is coming: If i mouseenter and mouseleave it now it is changing the image and if i disable the Bring toFront it is working?

    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;

    namespace KVzoekscherm
    {
    public partial class runtimeobject : Form
    {
    Button button1;
    Button button2;
    Bitmap image1;
    PictureBox pictureBox1;

        public runtimeobject()
        {
            InitializeComponent();
        }
    
        //Deze functie roept hij op wanneer hij over de (grote) picturebox gaat
        private void pbMaak\_Click(object sender, EventArgs e)
        {
            pictureBox1 = new PictureBox();
            pictureBox1.Name = "pictureBox1";
            pictureBox1.BringToFront();
            pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            pictureBox1.BorderStyle = BorderStyle.None;
            pictureBox1.ClientSize = new Size(15, 15);
            pictureBox1.Location = new System.Drawing.Point(50, 50);
            pictureBox1.Cursor = Cursors.Hand;
            pictureBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            pictureBox1.TabIndex = 28;
    
            image1 = new Bitmap(Properties.Resources.edit\_gray);
            pictureBox1.Image = (Image)image1;
    
            pictureBox1.Click += new EventHandler(editclick);
            pictureBox1.MouseLeave += new EventHandler(editleave);
            pictureBox1.MouseEnter += new EventHandler(editenter);
            this.Controls.Add(pictureBox1);
        }
    
        private void editenter(object sender, EventArgs e)
        {
            image1 = new Bitmap(Properties.Resources.edit\_color);
            pictureBox1.Image = (Image)image1;
        }
    
        private void editleave(object sender, EventArgs e)
        {
            image1 = new Bitmap(Properties.Resources.edit\_gray);
            pictureBox1.Image = (Image)image1;
        }
    
        private void editclick(object sender, EventArgs e)
        {
            MessageBox.Show("Clicked");
        }
    
        private void runtimeobject\_Load(object sender, EventArgs e)
        {
    
        }
    
        private void pbMaak\_Click\_1(object sender, EventArgs e)
        {
    
        }
    }
    

    }

    C# graphics csharp linq design help

  • Runtime ToFront toBack?
    D dennis_max27

    But: pictureBox1.SendToBack(); I will need to send pictureBox1 to the front :P That option doesn't Exist. SendToFront :(

    C# graphics csharp linq design help

  • Runtime ToFront toBack?
    D dennis_max27

    I've made a picturebox where I have a runtime code in. There i open a other Picturebox, but that picturebox I run runtime from the Design Picturebox is under the design picturebox and must be at the top. Hope somebody can help. Dennis,

    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;

    namespace KVzoekscherm
    {
    public partial class runtimeobject : Form
    {
    Button button1;
    Button button2;
    Bitmap image1;
    PictureBox pictureBox1;

        public runtimeobject()
        {
            InitializeComponent();
        }
    
        //Deze functie roept hij op wanneer hij over de (grote) picturebox gaat
        private void pbMaak\_Click(object sender, EventArgs e)
        {
            pictureBox1 = new PictureBox();
            pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            pictureBox1.BorderStyle = BorderStyle.None;
            pictureBox1.ClientSize = new Size(15, 15);
            pictureBox1.Location = new System.Drawing.Point(50, 50);
            pictureBox1.Cursor = Cursors.Hand;
            pictureBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            pictureBox1.TabIndex = 28;
    
            image1 = new Bitmap(Properties.Resources.edit\_gray);
            pictureBox1.Image = (Image)image1;
    
            pictureBox1.Click += new EventHandler(editclick);
            pictureBox1.MouseLeave += new EventHandler(editleave);
            pictureBox1.MouseEnter += new EventHandler(editenter);
            this.Controls.Add(pictureBox1);
        }
    
        private void editenter(object sender, EventArgs e)
        {
            image1 = new Bitmap(Properties.Resources.edit\_color);
            pictureBox1.Image = (Image)image1;
        }
    
        private void editleave(object sender, EventArgs e)
        {
            image1 = new Bitmap(Properties.Resources.edit\_gray);
            pictureBox1.Image = (Image)image1;
        }
    
        private void editclick(object sender, EventArgs e)
        {
            MessageBox.Show("Clicked");
        }
    
        private void runtimeobject\_Load(object sender, EventArgs e)
        {
    
        }
    
        private void pbMaak\_Click\_1(object sender, EventArgs e)
        {
    
        }
    }
    

    }

    C# graphics csharp linq design help

  • Change currently image?
    D dennis_max27

    Fixed the problem now. Thaks for the reply's!!

    C# question

  • Change currently image?
    D dennis_max27

    I've made this already: picBox1.MouseEnter += new EventHandler(EventHandlerName); picBox2.MouseEnter += new EventHandler(EventHandlerName); But I must declare in the eventhandler that it is changed the only the image the one where the mouse is hovering then, not all images. 1 eventhandler where he only works with the image where it's mouseentering and mouse leaving then. It's difficult to explain for me.

    C# question

  • Change currently image?
    D dennis_max27

    Im having 10 picturesboxes that im using as button. When im mouse over over now it is changed from image. and when i click on that button its openeing in every 10 buttons a different window. Have that now :) But all 10 picatureboxes must have the same mousenter and mouseleave event. SO i didnt't want to make 10 the same mouseenter and mouseleave events. Is it possible in 1?

    C# question

  • Change currently image?
    D dennis_max27

    First i had this:

    private void pbEdit_OnMouseEnter(object sender, EventArgs e)
    {
    pbTextEdit.Image = Image.FromFile("C:/data/edit_color.gif");

    } Now I wanna use 1 function for different pictureboxes: My code i was thinking of but didn't work :( this.Image = Image.FromFile("C:/data/edit_color.gif"); Dennis,

    C# question

  • MouseHover Picturebox problem
    D dennis_max27

    private void pbTextEdit_Click(object sender, EventArgs e)
    {
    Header header = new Header();
    header.Show();

        }
    
        private void pbTextEdit\_MouseHover(object sender, EventArgs e)
        {
            pbTextEdit.Image = Image.FromFile("C:/data/edit\_color.gif");
        }
    

    I'f im hovering it it ain't changing the image? What i wanna do is: Only when I'm moving with my mouse over the picturebox that it is changing from picture then. And when I leave it it is going back to the normal one in the properties. Dennis

    C# help question

  • Array list question
    D dennis_max27

    But this isn't working at any computer?

    C# question csharp linq graphics data-structures

  • Array list question
    D dennis_max27

    Changed my code, can I make it easier? TO read and write? I don't know much about C#... :) 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; namespace W1 { public partial class w1 : Form { public w1() { InitializeComponent(); } private void w1_Load(object sender, EventArgs e) { } private void exitToolStripMenuItem_Click(object sender, EventArgs e) { Application.Exit(); } private void btnDrop_Click(object sender, EventArgs e) { //Maakt een 2 maal 5 keer getallen aan Random random = new Random(); int randomNumber1C = random.Next(1, 7); int randomNumber2C = random.Next(1, 7); int randomNumber3C = random.Next(1, 7); int randomNumber4C = random.Next(1, 7); int randomNumber5C = random.Next(1, 7); int randomNumber1 = random.Next(1, 7); int randomNumber2 = random.Next(1, 7); int randomNumber3 = random.Next(1, 7); int randomNumber4 = random.Next(1, 7); int randomNumber5 = random.Next(1, 7); //Zet de 2 maal random 5 getallen in goede volgorde (speler) List<int> randomList = new List<int>(); randomList.Add(randomNumber1); randomList.Add(randomNumber2); randomList.Add(randomNumber3); randomList.Add(randomNumber4); randomList.Add(randomNumber5); randomList.Sort(); //berekening(speler) int last = 0; foreach (int itemInRandomList in randomList) { if (itemInRandomList == last || itemInRandomList - last != 1) { last = 0; break; } last = itemInRandomList; } //Resultaat of hij gewonnen of verloren heeft(speler) if (last == 0) { lblDropped.ForeColor = System.Drawing.Color.Red; lblDropped.Text = "LOST"; } else { lblDropped.ForeColor = System.Drawing.Color.Green; lblDropped.Text = "WON"; } //Zet de 2 maal random 5 getallen in

    C# question csharp linq graphics data-structures

  • Array list question
    D dennis_max27

    I'm making Yahtzee but I've 1 question: I've 5 stones which must be generated randomly between 1 and 6. If I've a 1,2,3,4 and 5 in this 5 stones it need's to display "GOOD" otherwise "LOST" SO 2,1,3,5,4 is "GOOD" SO 1,1,3,4,5 is "LOST" How can I do this can somebody help me please with it :^) So I can go further. I must work with array'sin my opinion but didn't have much knowledge of them :( Hope somebody can improve my code or say how I must do it. (I'm learning) My Code: 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; namespace W1 { public partial class w1 : Form { public w1() { InitializeComponent(); } private void w1_Load(object sender, EventArgs e) { } private void exitToolStripMenuItem_Click(object sender, EventArgs e) { Application.Exit(); } private void btnDrop_Click(object sender, EventArgs e) { Random random = new Random(); int randomNumber1C = random.Next(1, 7); int randomNumber2C = random.Next(1, 7); int randomNumber3C = random.Next(1, 7); int randomNumber4C = random.Next(1, 7); int randomNumber5C = random.Next(1, 7); lblDice1C.Text = "Dropped: " + randomNumber1C.ToString(); lblDice2C.Text = "Dropped: " + randomNumber2C.ToString(); lblDice3C.Text = "Dropped: " + randomNumber3C.ToString(); lblDice4C.Text = "Dropped: " + randomNumber4C.ToString(); lblDice5C.Text = "Dropped: " + randomNumber5C.ToString(); if (randomNumber1C == 1 && randomNumber2C == 2 && randomNumber3C == 3 && randomNumber4C == 4 && randomNumber5C == 5 || randomNumber1C == 2 && randomNumber2C == 3 && randomNumber3C == 4 && randomNumber4C == 5 && randomNumber5C == 6) { lblDroppedC.ForeColor = System.Drawing.Color.Green; lblDroppedC.Text = "WON"; } else { lblDroppedC.ForeColor = System.Drawing.Color.Red; lblDroppedC.Text = "LOST"; } int randomNumber1 = random.Next(1, 7); int randomNumber2 = random.Next(1, 7); int randomNumber3 = random.Next(1, 7); int randomNumber4 = random.Next(1, 7);

    C# question csharp linq graphics data-structures

  • Deplying a C# Application with Database Connection!
    D dennis_max27

    I've a application running now with a database connection and wanna make a deployment of it I tried much things. So that's why I'm asking now is there a easy guide to follow where I can see what to do. My connection string is hard coded, after I deployed the application it's still hard coded what is the way to let the Data Source (Computer Name) change automaticly to the new computername where it is installed? (return @"Data Source=KONING-AF02EAF7\SQLEXPRESS;Initial Catalog=KringVrienden;Integrated Security=True";) SofwareI'm using: Visual Studio 2008. SQL Server 2005 SQL Management Server 2005 Please help me. Dennis,

    C# csharp database sysadmin question sql-server
  • Login

  • Don't have an account? Register

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