473,657 Members | 2,530 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

onclick change property value of form position

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.Collecti ons.Generic;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows. Forms;

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

public delegate void NoviDelegat(obj ect prvi, EventArgs drugi);

public Form1()
{
InitializeCompo nent();
}

private void button1_Click(o bject sender, EventArgs e)
{
Form2 test = new Form2();
test.Otvori += new Form2.OtvoriDru giProzor(Funkci ja);
test.Show();
}

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

private void button2_Click(o bject prvi, EventArgs drugi)
{
Form1 p = new Form1();
NoviDelegat d = new NoviDelegat(p.F unkcija);
d(prvi, drugi);
}

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

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

private void button5_Click(o bject sender, EventArgs e)
{
}
}
}
Jun 20 '07 #1
1 2394
Zeljko,

You will want to use the DesktopBounds property to set the location of
the form in relation to the desktop.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Zeljko" <Ze****@discuss ions.microsoft. comwrote in message
news:88******** *************** ***********@mic rosoft.com...
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.Collecti ons.Generic;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows. Forms;

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

public delegate void NoviDelegat(obj ect prvi, EventArgs drugi);

public Form1()
{
InitializeCompo nent();
}

private void button1_Click(o bject sender, EventArgs e)
{
Form2 test = new Form2();
test.Otvori += new Form2.OtvoriDru giProzor(Funkci ja);
test.Show();
}

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

private void button2_Click(o bject prvi, EventArgs drugi)
{
Form1 p = new Form1();
NoviDelegat d = new NoviDelegat(p.F unkcija);
d(prvi, drugi);
}

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

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

private void button5_Click(o bject sender, EventArgs e)
{
}
}
}

Jun 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5733
by: Draken | last post by:
I have a function in the head section of a html and call it from a radio button with onClick="menu();" but IE tells me that the object doesnt support this method or property. What is the problem with that? I have tried numerous ways around it but to no avail. <head> function menu() { for (i=0;i<=2;i++) { if (document.menuform.menu.checked=="1") { parent.main.location.href="document.menuform.menu.value + '.html'" }
14
28128
by: Erik | last post by:
I need to submit a form using a hyperlink, and I need to pass a variable associated with that hyperlink. Example: I have a page where employees enter event information, and they are supplied a dropdown box to pick the promoter for that event. If the promoter does not exist in the database, they need to add him/her to the database so that the promoter can be associated with the event. If the promoter does not exist, I want to provide a...
3
60093
by: Zalek Bloom | last post by:
Hello, Here is my problem: I am displaying to a user a row of buttons. Depending on which button user presses, I want to go to a different URL and to give a different value to a hidden variable. My code is: <FORM NAME=FORM1 ACTION=""> <input type="button" name="B1" onclick="ModC('1')">
8
9540
by: cool2005 | last post by:
I tried to dynamically add/clone a <tr> from an existing <tr> to a <table> but the problem is that I need to have a "onclick" event handler in the <tr>. I have tried following A. approach 1. 1. find the <tr> that I will insert <tr>s right after it
2
3861
by: alien2_51 | last post by:
Can some one tell me why the onclick is firing twice for the radion button and checkbox controls...? <%@ Page Language="vb" AutoEventWireup="false" Codebehind="Testing.aspx.vb" Inherits="CustomerRelations.Testing" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <title>Testing</title> <!--
2
2521
by: Richard Morse | last post by:
Hi! I have an aspx that I've created which has an asp:Button in it. I would like to be able to change the OnClick handler at runtime (basically, I want this form to either edit or create a record, and I want to change the procedure it calls depending on what it should be doing). However, apparently the .OnClick member is read only? (Sample:) <script language="jscript"> function do_edit() {
0
3157
by: Diane Yocom | last post by:
I'm very new to ASP.Net and probably jumped in a little over my head, but... I'm trying to create a user control that will control navigation through my site. It's sortof like Amazon.com, where there are tabs at the top with "submenu" buttons showing below the selected tab. The data that defines the tabs and submenus is stored in an XML file and I'm using nested repeaters to build them dynamically. I've got it working pretty well, except...
5
2106
by: Fred.Grieco | last post by:
Hi every body, I have a little pb and I'm turning around : function MyFCTN(var1,var2) { var mytable = document.getElementById("myTBL"); for (var i=myTBL.childNodes.length-1; i>0; i--){ myTBL.removeChild(myTBL.childNodes); } for(var i=0; i<var1.length; i++){
7
5154
by: yywangwang | last post by:
I followed the steps in http://www.thescripts.com/forum/thread147546.html and use it for a button. I have a button inside a form defined as this: <input name="save" type="button" value="Add" />" class="submit_rt" alt="Save Note" onClick="add();" /> I want to change the onClick property dynamically. If I do something like this to change the onClick method for the method: document.getElementById('save').value = 'Update';
0
8844
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8742
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8621
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7354
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.