|
Thanx a milion!
It really workes.
But I'm really gonna'miss that ability!(It was faster and easier)
Anyway, thanx again. ;P
Sojaner
|
|
|
|
|
Hi guys. ...I'm working on a program to hone my skills a little bit cuz I've been out of the game for a while. So, I've got an MDI child form and the parent has a panel on the left side that contains my GUI controls. Whenever my child opens, I don't want it to be able to be moved behind the parent's GUI control panel. Two logical solutions I've come to would be to make the child forms immovable but I don't wanna have the screen flicker while the forms move method is resetting the location of the form to the default location. I know that I could call a paint to a backbuffer and do a swap to remove the flicker, but I was hoping that someone knew of a simpler solution. Is there any way to disable the child form titlebar's selection property? [edit: I want the form to have a border, so setting the BorderStyle to None does not solve my problem] ...Better than that, would be my second option. Ideally, I would like to be able to move the child form around in the parent form's available workspace but not allow it to move behind the control panel. The only solution to this that I can think of would be to compare the top-left's Location.X component to the width of my control panel, but everything I've tried hasn't worked. Anyone have a solution to either of these options? Or at least can someone point me in the right direction? ...I'm asking for help on this because it's trivial to my application, but I'd like to make my interface look as nice as possible.
-- modified at 0:10 Tuesday 12th September, 2006
|
|
|
|
|
Hello
Well, I didn't want to reply hoping that someone would grap a better idea!! One lousy way of doing it is capturing the mouse by the parent form to prevent the user from further movement:
if(MDIChild.Location.x < MinX)
{
MDIChild.Location = new Point(MinX, MDIChild.Location.y);
this.Capture = true;
}
else if(MDIChild.Location.y < MinY)
{
MDIChild.Location = new Point(MinX, MDIChild.Location.y);
this.Capture = true;
}
You can put the above code in the parent -if you keep a track of the child forms-, or in the child. The idea is to check the current position, and resetting it if necessary, then capturing the mouse from the child form to stop further moving.
One stupid drawback is that you have to click somewhere before the mouse returns to normal -ie. release the capture-. I didn't figure out a workaround, but I'm sure you can make it.
Regards
|
|
|
|
|
I tried something similar to that when I first approached the issue, but VS kept telling me that I couldn't perform the comparison "form.Location.X< minX" because Location.X was not a variable. I looked at the documentation for the member functions and I could not for the life of me find any combination of anything that would allow me to actually pull the X and Y components out of the location to perform a comparison.
|
|
|
|
|
That's weird!! This error appears when you try to change the X or Y values not read them!! Try again to compare them without changing. If you want to change the location use the new Point(X,Y) statement.
Also I don't have top remind you that you access them by instance not by class. They are not static members.. If nothing is working -for some reason or the other-, use the Form.Left and Form.Top properties instead.
Regards
|
|
|
|
|
I've decided a course of action since my original posting of this afternoon. What I have done is gone into Photoshop and created my own form bitmap mask. I placed a simple(not really, it's rather complex ) border on the edge of the image so now I can set it to my background image and then set my formBorderStyle to None while still having a border. But, if I'm gonna go to all that trouble for a stupid border, I'm gonna go a little bit over the top, which I did. I cut out a shape for my form so that the upper left is at the standard border position (so I can put buttons for my form controls) but about a third the way from the left, I drop the edge down and run it to the far right side with a rounded corner.
(Now to my new issue) ...I've never tried this, so I'm kinda stuck and I can't find any info on it. My main form is an MDI parent, and the custom-shaped form with the transparency mask is a child. The transparency works, but instead of dropping the transparency to the background of the parent form, it performs full transparency and ends up falling through to my desktop background. Has anyone ever tried doing this and come up with a solution to this issue? ...Sometimes I really, really hate Windows : P (*Rumbling* ...I didn't mean it, I didn't mean it!!)
|
|
|
|
|
Are you that desperate? check the Form.Left property as I told you in my previous post!!
Regards
|
|
|
|
|
can someone send me a backtracking program solving sudoku puzzle
|
|
|
|
|
I'm sure there are many people here willing to do that for their normal hourly fee.
Oh wait, you wanted to get something for free without doing any work?
|
|
|
|
|
Hello
Did you seach the articles[^] first?
[edit]
First, welcome to CP. I know you are new here, but there are simple rules you must follow before posting in the forums. If you want to learn about a topic in general -as the case now- you should search the articles for samples and walkthroughs. The link I provided to you above should give you a good start. If you have a specific question about something you stuck in, you can post it in the appropriate forum.
May I suggest that you revise Chris' Posting Guidlines[^]. It should give you a good idea on how to post.
Regards
|
|
|
|
|
Dear jonathan
would you, could you, send me a backtracking student who does not post his assignments to the cpians?! I wish you could, you munkey turd, because every time i get student he posts assignments on cpians like a little cheatingers. now i will go sing an hindu lamentation over your failures as a human being.
Sincelery yours, Computer Information conSciences Professor and grader, Sharada Ulhas
|
|
|
|
|
make no doubt u must no, post homework assignments to cpian projectiles.
|
|
|
|
|
I have an XSD with a datatable called typedTable. There are 6 fields in that table.
First, Last, Address1, City, State, Zip.
I have datatable with a single record. Same column names in the table, except there is no value for the City, State, Zip.
First, Last, Address1, City, State, Zip.
I am trying to cast the [on the fly datatable] to the typedTable. I get the object ref error.. I have used the DataTable's writexml method and it wrote only the first 3 columns being there are no values in the last three.
Please advise,
Thanks in advance...
Shrini Viswanathan
|
|
|
|
|
try fill your dataset in code instead of reading and writing XML files.
|
|
|
|
|
static ArrayList Permute(int[] a,int start,int finish))
{
if(start!=finsh)
Permute(a,start+1,finish)
}
In this recursive function I need to add the int [] a(array) collection to array list and return the array list how can I do that?
(simply how to add values to a array list in a recursive function and the return the array list with all values)
like (
arraylist alist =new arraylist();
alist .add(1);
alist .add(2);
then return alist
but this wont work in recursive function like above
due
each time alist get reinitialized
|
|
|
|
|
I think that you don't want to do what you are asking for at all. I think that you want to create the ArrayList once, and use it in the recursive function.
Create the ArrayList before you call the recursive function, and pass the reference to the ArrayList as a parameter:
static void Permute(int[] a, int start, int finish, ArrayList results)) {
results.Add(a);
if (start != finish) {
Permute(a, start + 1, finish, results);
}
}
---
b { font-weight: normal; }
|
|
|
|
|
Hello
Again?!! Why do you insist on making it in a recursive call?? One line of code is enough:
ArrayList MyArrayList = new ArrayList(a);
If you insist, you can check if the ArrayList is already initialized before reinitializing it:
ArrayList alist;
static ArrayList Permute(int[] a, int start, int finish)
{
if(alist.Count == 0)
alist = new ArrayList()
alist.Add(1);
alist.Add(2);
if(start != finish)
Permute(a, start+1, finish)
return alist;
}
but I'm sure there is a much better way of doing whatever you are trying to do!! Please post more details about what you are trying to do, perhaps we code suggest a better approach.
Regards
|
|
|
|
|
Hey all,
I am trying to create a windows.forms.control object that has the resize function like a normal windows.form object (real-time windows.form size change displayed). Can anyone help me with it? I cannot find a way to do it, been searching for awhile and cannot find any way to do so.
Thanks in advance!
Tom
|
|
|
|
|
Hello
Well, I guess you have to do it manually!! Have a lok at this article[^].
Regards
|
|
|
|
|
Hey Nader
Thanks for your help!! I couldnt find it before!! Thx Thx
Tom
|
|
|
|
|
I have a DataGrid. I want to enable a "commit" button once the user modifies any column in the row. When user leaves that column (CurrentCellChanged event fires) -- I check the underlying DataSet for changes via DataSet.HasChanges(). If user has clicked anywhere outside of original row - still in grid or otherwise --- no problem. Problem is if user simply stays within the original row --- no changes have been detected by the dataset yet.
I have done some searching and found others with this problem, but haven't found a solution --- mostly frustrated comments as to why this appears to be so difficult. Anyone know how to detect that the datagrid has a change that is about to be committed to the dataset as soon as the user leaves the current row??
Thanks in advance.
John
|
|
|
|
|
Hello
The problem is -as I got from your post- that you want to detect changes made to the DatagridView -or was that DataGrid only?- when the user changes the content of one cell and moves to another cell within the same row, right??
Well, DatagridViews don't signal changes until you commit the current row to the current transaction. That means that until you actually leave the row, you still have a chance to cancel your changes. The unit of editting is the row, not the cell. So, if you want to narrow the spectrum of changes detection, you have to do it manually by handling events like CellEndEdit if you use .Net 2.0 framework.
Regards
|
|
|
|
|
Thanks Nader.
You've confirmed what I thought. And no, I'm using 2003 Vis Studio with 1.1, so don't seem to find the CellEndEdit event. I guess I can instruct users to do an extra click outside the row to enable the "commit" button. Not really sure why this wasn't as obvious to MS earlier but if I understand correctly, they've provided a solution in the newer version, but still with a little more intervention than maybe one should have to make.
It seems so natural that as soon as you make any change, the user should immediately have the ability to save the change -- i.e., shouldn't be told "click here so you can click someplace else".
Thanks again for your info.
John
|
|
|
|
|
"Hello Dear brother please read u'r mail and reply me a soon as possible. But u must reply. I am waiting. Have u read the mail?"
Syed Shahid Hussain
|
|
|
|
|
I've got a problem with this code in C#:
Controls[id + "gbR" + r].Controls[id + "rtbRunda" + r + "ABin"].ReadOnly = p;
The first Control is GroupBox, the second is RichTextBox, 'id' and 'r' is an integer. I want to change the ReadOnly property, but compilator throws na error: "'System.Windows.Forms.Control' does not contain a definition for 'ReadOnly'"
What should I do? I've tried some casting, but without success.
Thanx for any help!
|
|
|
|