|
Hi to all,
I have a problem regarding form resizing. I am devloping a window application using C#.NET. I am using an MDI Form to open other Forms. I have set padding property of that MDI Form.
The problem I have is, whenever I am Changing the screen resolution My form does not resize.
Please help me to solve my problem. How can I resize my window Form dynamically as per the screen resolution changes or is there any solution so that eventhough the screen resolution changes My form design should not change
--
Thanks & Regard
Sanket Patil.
.
|
|
|
|
|
Catch the Microsoft.Win32.SystemEvents.DisplaySettingsChanged and DisplaySettingsChanging events. When you receive the DisplaySettingsChanging event, make a note of the then-current resolution. When you receive the DisplaySettingsChanged event, get the current resolution. You now have the two needed resolutions; if they're equal, you don't need to do anything. If they aren't, then the Form's width is [PreviousWidth * (previousResolution.Width / currentResolution.Width)] and the height applies the same formula, but with heights instead of width
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
How do I get a form to lock focus to where the user cannot switch to the parent window without closing it first?
Y*Live Long And Prosper*Y
|
|
|
|
|
False Chicken wrote: How do I get a form to lock focus to where the user cannot switch to the parent window without closing it first?
It can be Simply Done by ShowDialog() method.
Form frmNew = new Form2();
frmNew .ShowDialog();
Hope this will help you
|
|
|
|
|
Worked like a charm! thanks
Y*Live Long And Prosper*Y
|
|
|
|
|
hi
i am doing a setup of a Project developed in c#
now while installing (at the begining of installation process) the setup
i want to know the person role who is installing
i mean , if the installing person is a user then it should not be installed/uninstalled
The installation/uninstallation rights should have for only admin but not users
is there any solution for this...
|
|
|
|
|
This can only be done by your System Administrator or Network Administrator. To deny users rights to install anything or uninstall anything.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
How are you creating the setup?
I know you can check if the user is an admin and cancel the installation using WiX[^]
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
vijaylumar wrote: i am doing a setup of a Project developed in c#
The question here is - what do you mean by "doing a setup"? Are you using a setup program or writing code to build an installer? Which OS are you targeting? If you're using an installer, there's nothing more that you need to worry about, because an "installation" can be done only by an administrator.
If you're writing it yourself, it's a matter of mentioning it in your project's manifest file that it needs administrative privileges. (line of interest would be level="requireAdministrator" under requestedExecutionLevel , if I remember it right... can't pull it off now, not on a dev machine. Just google if doubtful).
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
hi
i m doing setup using .net ide i.e Setup and Deployment Project Type
|
|
|
|
|
hello, I have an usual problem ( a least for me ), where I created multiple objects (say b1, b2, b3 ,b4 ) from the same class (b) inside another class (class a), the object is a1.
The variable for class b such as "value" is changed for every object, for example
a1.b1.value = 10;
also a1.b2.value = 20;
..
..
..
now when the value of 20 is entered in b2 the value in b1 is also changed to 20.
Did anyone see this problem earlier?
thanks
|
|
|
|
|
Hi,
show actual code (in PRE tags!) and someone will explain to you what happened.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
At a guess, it sounds like when you create your objects you are ending up with them all pointing to the same reference but without code it's hard to explain what is happening.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
sounds like u did a code by using reference type.. so that it copied 20 to another object also..But we need to examine the code
sureshkumar.S
|
|
|
|
|
Hi everyone,
I'm very new to programming and have run into a snag that I can't seem to figure out.
I have some pretty simple classes for a grading program. I have four classes (Course, Student, Assignment, StudentAssignment) StudentAssignment inherits from Assignment and adds a grade and notes.
Course has a list<assignment>
Student has a list<course> and a list<studentassignment>
When I add a course to Student list<course> I use the constructor for StudentAssignment to add a studentAssignment for every assignment in list<course>
Now, I need to keep the two in sync. What is the best way to do this. I tried foreach loops but since I can't downcast Assignment to StudentAssignment it's tough to compare the two.
I know there's probably a million ways to do it. Can anyone help?
|
|
|
|
|
Without seeing at least the basics of what you have setup it's difficult. What do you mean "keep the two in sync"? Which "two" are you referring to?
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
my original post didn't work right.
It should say course has a List<<Assignment>>
Student has a List<Course> and a List<StudentAssignment>
Since the student takes a course, all the assignments from that course should be in their Student assignment list.
The two things I need to keep in sync are the Assignment list from the course and the assignment list for the student. When I add or delete an assignment from the course assignment list, it needs to be added or deleted in the student assignment list also. If I delete a course from the student course list, I need to delete all assignments related to that course from the student list also. That's what I mean by "keep the two in sync"
|
|
|
|
|
Again Sorry.
Course has a List<Assignment>
|
|
|
|
|
Ok...that makes a bit more sense. There are several possibilities to accomplish this.
One option is to derive concrete collections for your course list and assignment list (CourseList : List<Course> and AssignmentList : List<StudentAssignment> ) and in those concrete collections override the Add/Insert/etc. methods to raise events that your other classes can then respond to and ensure that they update their appropriate fields.
A similar option would be to derive from BindingList<T>, where T is Course and StudentAssignment, and have your other classes respond to the ListChanged event.
Yet another option is to simply use List<T> like you have and either provide your own methods to do the Add/Insert/etc. and when you take an action on one list be sure that you take the appropriate action on the other list at the same time.
There are probably other ways to achieve this, but these are the ones I can think of off-hand. Each has benefits and drawbacks and one is not necessarily any better than another.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Thanks Scott, this was very helpful.
I'm now using WPF and ObservableCollection for ease of binding. I slightly modified your third suggestion and added a "Synchronizer" class and call it's add / modify / remove methods every time I add / remove / or modify any of the lists. Thanks again for the help.
|
|
|
|
|
First off, I'm guessing you didn't escape some angle-brackets (<>) in your post.
|
|
|
|
|
|
You asked this less than 12 hours ago! You should have continued on your original thread.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
ohh ooops....i couldnt find it so just thought would ask a new one..
Cheers!!
|
|
|
|
|
If you go to your profile page and click on Messages Posted you can get a list of direct links to your past 200 messages
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|