473,324 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Change the location of control at runtime in WPF application.

How to change the location (left and top) of the image control in wpf windows application at runtime?
Jun 18 '08 #1
2 4174
cloud255
427 Expert 256MB
To move a control at runtime (in C#):

create a new point:
Expand|Select|Wrap|Line Numbers
  1. system.drawing.point pt = new system.drawing.point();
set the new co-ordinates:
Expand|Select|Wrap|Line Numbers
  1. pt.X = newX;
  2. pt.Y = newY;
set the co-ordinates of your control:
Expand|Select|Wrap|Line Numbers
  1. myControl.location = pt;
  2. myControl.refresh();
  3.  
and the control should have moved.
Jun 23 '08 #2
lcgg15
2
in wpf, there is no .location
Mar 1 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: RF | last post by:
Before .Net if I wanted to control an application that exposed a COM interface all I needed to do was to create an object of that application and call the appropriate methods. For example a VB app...
1
by: Shan | last post by:
Hi, I used the Internet Explorer browser version 6.0 to download and run .NET windows application. However, it only ran on the computer where the http server is residing on. It did not run on...
6
by: Nou Dadoun | last post by:
I'm currently developing an application in C++/MFC (Visual Studio 6, if that makes a difference) and I'd like to avoid the Windows style UI widgets and dialogs if at all possible. In fact, what...
3
by: | last post by:
Hi,all I want to change Control's size&location in runtime ,(C#) but i dont know how to do! :(so, can you provide me with document about this. my email: zhonghua@rinpak.com.cn ...
4
by: active | last post by:
It appears to me that if I change the Control's client size the controls size does not change to agree with the new size. Does it work like the VB6 ScaleWidth and ScaleHeight? That is after I...
6
by: Stewart Saathoff | last post by:
Hello, I would like to programatically redirect the location of a web service from the client machine. Let me explain further. This is the exact process: I would like the client to click a...
2
by: monomaniac21 | last post by:
Hi all is it possible to get a button in an iframe to change location of parent page? regards marc
1
by: libsfan01 | last post by:
Hi all is it possible to get a button in an iframe to change location of parent page? regards marc
2
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
I added a change password control to my application and when I run the page that has it, I get an error: Generating user instances in SQL Server is disabled. Use sp_configure 'user instances...
1
by: joey0714 | last post by:
I have a Crystal Report that I need to change the database location during runtime. Does anyone know how to do this? I have tried different ways and they all have errors. Here is a copy of my code: ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.