Click here to Skip to main content
15,886,026 members
Home / Discussions / C#
   

C#

 
QuestionFreehand drawing on WPF Pin
softwareengr27-Oct-08 19:14
softwareengr27-Oct-08 19:14 
AnswerRe: Freehand drawing on WPF Pin
leppie28-Oct-08 1:14
leppie28-Oct-08 1:14 
AnswerRe: Freehand drawing on WPF Pin
Pete O'Hanlon28-Oct-08 2:32
mvePete O'Hanlon28-Oct-08 2:32 
QuestionAutomating mpp using late binding Pin
DJ24527-Oct-08 18:27
DJ24527-Oct-08 18:27 
Questioncan not connect with .xls file Pin
HowIsIT27-Oct-08 17:47
HowIsIT27-Oct-08 17:47 
AnswerRe: can not connect with .xls file Pin
Parwej Ahamad27-Oct-08 18:23
professionalParwej Ahamad27-Oct-08 18:23 
GeneralRe: can not connect with .xls file Pin
HowIsIT27-Oct-08 23:12
HowIsIT27-Oct-08 23:12 
QuestionSimple screensaver crashing Pin
Data_Dragon27-Oct-08 14:00
Data_Dragon27-Oct-08 14:00 
i am rather new to C#, i am switching from java, i followed through with a baisic c# screensaver tutorial, then i tried to add a picture and make it bounce around the screen. i added a picture box set to a picture(LM), i made a loop to make it move, then tried to figure out how to start it, i added it the end of load. this is probably extremely noobish and i am sorry,but if someone would help thatd be great
//Form1.cs--------------------------------------------------------------------

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

namespace ScreenSaver
{
    public partial class Form1 : Form
    {


        private int screenNumber;
        private Point MouseXY;
        int curX = 1;
        int curY = 1;
        Boolean running = true;

        public Form1(int screen)
        {
            screenNumber = screen;

            InitializeComponent();
            this.run();
           
        }
        private void form1_Load(object sender, System.EventArgs e)
        {
            this.Bounds = Screen.AllScreens[screenNumber].Bounds;
            Cursor.Hide();
            TopMost = true;
           
        }
        private void onMouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            if (!MouseXY.IsEmpty)
            {
                if(MouseXY != new Point(e.X,e.Y))
                {
                    running = false;
                }
                if(e.Clicks >0)
                {
                    running = false;
                }
            }
            MouseXY = new Point(e.X, e.Y);
           
        }
       public void run()
        {
                while (running)
                {
                    loopMove();
                    Thread.Sleep(1000);
                }

                Close();
        }

        private void LM_Click(object sender, EventArgs e)
        {

        }
        private void changeLMY(int y)
        {
            LM.Left += y;

        }
        private void changeLMX(int x)
        {
            LM.Top += x;
        }
        private void loopMove()
        {
            int fX = this.Top;
            int fY = this.Left;
            if (LM.Top >= fX - 300)
                curX = -1;
            if (LM.Top == 0)
                curX = 1;
            if (LM.Left >= fY - 300)
                curY = -1;
            if (LM.Left == 0)
                curY = 1;
            changeLMX(curX);
            changeLMY(curY);

        }
    }
}
//---------------------------------------------------------------------------------------- end Form1


// Program.cs----------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace ScreenSaver
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(String[] args)
        {
            if (args.Length > 0)
            {
                if (args[0].ToLower().Trim().Substring(0, 2) == "/c")
                {
                }
                else if(args[0].ToLower()== "/s")
                {
                }
                else if (args[0].ToLower() == "/p")
                {
                }
              

            }
            else
            {
                for (int i = Screen.AllScreens.GetLowerBound(0); i <= Screen.AllScreens.GetLowerBound(0); i++)
                {
                    System.Windows.Forms.Application.Run(new Form1(i));
                }
            }
        }

//end program.cs

Questionresources in solution Pin
nelsonpaixao27-Oct-08 13:10
nelsonpaixao27-Oct-08 13:10 
AnswerRe: resources in solution Pin
DaveyM6927-Oct-08 15:50
professionalDaveyM6927-Oct-08 15:50 
Questionthread abort exception when service ends to where it has been invoked from Pin
stephan_00727-Oct-08 13:04
stephan_00727-Oct-08 13:04 
AnswerRe: thread abort exception when service ends to where it has been invoked from Pin
Guffa27-Oct-08 15:48
Guffa27-Oct-08 15:48 
GeneralRe: thread abort exception when service ends to where it has been invoked from Pin
stephan_00727-Oct-08 23:29
stephan_00727-Oct-08 23:29 
QuestionSplitting up a list of things. Pin
Buckleyindahouse27-Oct-08 11:08
Buckleyindahouse27-Oct-08 11:08 
AnswerRe: Splitting up a list of things. Pin
Guffa27-Oct-08 11:19
Guffa27-Oct-08 11:19 
QuestionFormat The XML with Csharp Pin
zjaffary27-Oct-08 10:35
zjaffary27-Oct-08 10:35 
AnswerCross post and Repost Pin
led mike27-Oct-08 11:03
led mike27-Oct-08 11:03 
GeneralRe: Cross post and Repost Pin
Paul Conrad27-Oct-08 12:30
professionalPaul Conrad27-Oct-08 12:30 
QuestionSpeeding up DataGridView RowCount assignment Pin
AndrusM27-Oct-08 10:10
AndrusM27-Oct-08 10:10 
AnswerRe: Speeding up DataGridView RowCount assignment Pin
Wendelius27-Oct-08 10:23
mentorWendelius27-Oct-08 10:23 
GeneralRe: Speeding up DataGridView RowCount assignment Pin
AndrusM27-Oct-08 10:28
AndrusM27-Oct-08 10:28 
GeneralRe: Speeding up DataGridView RowCount assignment Pin
Wendelius27-Oct-08 10:49
mentorWendelius27-Oct-08 10:49 
GeneralRe: Speeding up DataGridView RowCount assignment Pin
AndrusM27-Oct-08 23:53
AndrusM27-Oct-08 23:53 
GeneralRe: Speeding up DataGridView RowCount assignment Pin
Luc Pattyn27-Oct-08 10:33
sitebuilderLuc Pattyn27-Oct-08 10:33 
GeneralRe: Speeding up DataGridView RowCount assignment Pin
AndrusM27-Oct-08 22:58
AndrusM27-Oct-08 22:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.