onclick change property value of form position

G

Guest

Hello! I am new in programing and I have this problem: I must on
button5_Click move current form. The code of form is:

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

namespace WindowsApplication1
{
public partial class Form1 : Form
{
private string ime;
public string Ime
{
get { return ime; }
set { ime = value; }
}

public delegate void NoviDelegat(object prvi, EventArgs drugi);

public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
Form2 test = new Form2();
test.Otvori += new Form2.OtvoriDrugiProzor(Funkcija);
test.Show();
}

public void Funkcija(object jedan, EventArgs dva)
{
MessageBox.Show("Funkcija na event");
}

private void button2_Click(object prvi, EventArgs drugi)
{
Form1 p = new Form1();
NoviDelegat d = new NoviDelegat(p.Funkcija);
d(prvi, drugi);
}

private void button3_Click(object sender, EventArgs e)
{
Ime = "NOVO SVOJSTVO";
}

private void button4_Click(object sender, EventArgs e)
{
MessageBox.Show(Ime);
}

private void button5_Click(object sender, EventArgs e)
{
}
}
}
 
N

Nicholas Paldino [.NET/C# MVP]

Zeljko,

You will want to use the DesktopBounds property to set the location of
the form in relation to the desktop.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

need a simple animation tool 2
c# Favorites 5
Pass values b/w forms using properties 4
Usercontrol - Loading into SplitContainer 8
RDP - C# 0
RDP / C# 1
Calling a hidden form 6
databinding to a combobox 1

Top