|
As far as i understand your problem that is when you call formY then it shows behind the formX or lost focus when you click on its controls
if yes then you can solve it by 3 ways
1.use ShowDialog()
2. before calling FormY then set its TopMost property to true (perhaps it work)
3. write this.Focus() in Deactivate event of FormY
Becoming Programmer...
|
|
|
|
|
Hi xmen_xwk ,
many thanks 4 ur reply. Right now Form Y is being shown , thats not an issue.
Actually what i`m trying todo here is make a set of Forms work together and we can interact with any form at any time even though they are in separate exe`s.
For eg: , do like minimize together , toggle between various owned forms(1 owner form is controlling a set of other owned form`s being shown or hidden),display them in a predefined part of the screen etc..
* showdialog() is a good idea but if i do it then i must close the Form Y and only then i can interact with Form X right ? so the blocking call causes problems
* Plus doing this.focus() in deactivate means i can never transfer control away from Form Y
* All the forms are non-topmost bcoz then they will then be minimized and restored together. Would u suggest changing the TopMost value on various events like OnMinimize or LostFocus ?
that sounds promising.will try that
Theres a "hack" i`ve tried as below with some dummy form A :
Form A (grand-owner) : Form X (Owner) : Form Y (Owned)
All are topmost=false , Showintaskbar = true only for Form X and is false for others.
This helps solve the Keyboard focus problem , but i cant really put a "dummy form" into the actual production system code.
If its ok with u I could also mail a copy of the sample project for this issue.
|
|
|
|
|
buddy your problem is strange for me because i still not understood what is the problem and what are you trying to do....
if you explain exact what you want (if you like) then it will be better to understand.
i just understood that you want to interact in all 3 forms....
Becoming Programmer...
|
|
|
|
|
hi , just tried the options u`ve suggested... unfortunately the problem still remains
ShowDialog() works but then i must close that form before interacting with any other forms.
Was the sample i uploaded useful ?
|
|
|
|
|
did you try Show()?
if yes then try again, after enable the topmost of the form
Becoming Programmer...
|
|
|
|
|
Hi Everybody
If anyone can one help me to change the traditional title bar for a window form in C# so i can use an image insted of that and can atach button such as Minimize, Maximize and Close of my own design
please help me by example or give me any reffrence urls for help
thanks
Altaf
|
|
|
|
|
You need to set the FormborderStyle to None and then create your own title bar from scratch. It's actually easy.. Just drop some labels, buttons, whatsoever at the top of your form. Or perhaps create a panel just for the title bar.
Kristian Sixhoej
"Failure is not an option" - Gene Kranz
|
|
|
|
|
Hi Kristian Sixhoej
Thanks for quick response
That thing was also in my mind but i was thininking that is there any method to overide it.
the prolem is this when i hv about 25 forms then it will be a tedious task what u think?
i want some wrriten method just written one time any copy paste to toher forms. Possibely by overriding paint method or ........ but i hv no idea yet about overriding paint method (i mean what can i do with it. Is the thing i m saying is possible with this or not)
waiting for ur reply.
|
|
|
|
|
As far as I know, it isn't possible to change the title bar programmatically (except from changing the text, but that could just be done via the Text property). The easiest and most comfortable way would propably be to do it in this way. But then you also have 100% control over what the title bar will get to look like.
EDIT: By the way, if you're experienced in doing user controls, you could make the title bar as a user control and just drag and drop it onto each form.
-- modified at 15:36 Friday 23rd November, 2007
Kristian Sixhoej
"Failure is not an option" - Gene Kranz
|
|
|
|
|
Hi Kristian Sixhoej
Is there any method when i click on a button labeled as "Minimize" the form get Minimized (and for maximize also) i have not found that in inteliSense Popup with this handle
|
|
|
|
|
|
For Maximize and Minimize, use
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
Becoming Programmer...
|
|
|
|
|
Hi,iam in windows application.
sales module.
iam billing the products which are taken by the customer..
that billing iam doing in datagrid control.
now my problem is :
i want give print in different format..(invoive print format)
please suggest what type of procedure can i follow.
if u have any sample code related to this project please
send me..
thanking you,
murali krishna
|
|
|
|
|
Hi,
I have a datagridview and print button when i click the print button the datagridview data has to come on that pdf page and then i want to print.
so if i have 10rows in datagridview means in 10pdf pages it has to print means 1row in 1pdf page.
kirankumar
|
|
|
|
|
|
Hi all,
I try to create a custom form: border size - none.
I need to resize(by mouse)this form.
Can you give me any hint?
Thanx.
davena
|
|
|
|
|
The answer is you can't resize it.Better you try with Other properties in thr FormBorder
Regards,
Nags
bgfhrtydgfdhfghhdf
|
|
|
|
|
Hi, Nags
thanks for your reply,
I found formborderstyle property, it sets none.
When formborderstyle-none is set, I am not able to resize this form.
Does it exist any property which can do that or I have to do in the code?
daavena
|
|
|
|
|
You can modify the Form's size by setting its Size property to a new Size instance.
If your Form does not show a border, there is no default way to graphically control its size.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi Luc,
thank you for replay,
I need form without title bar, and no minimize, close etc buttons. I can use(I think) only FormBorderStyle-none. There is no border.
Am I able to do it by of another component - StatusStrip.
I think, it must exist a way how to do that - for example QuickTime Player
Thanx.
daavena
|
|
|
|
|
As I said before, there are two distinct things:
1. you CAN move and resize a form programmatically by assigning a new value to the
corresponding property (new sizes have to agree with MinimumSize and MaximumSize)
2. you probably need a way to let the interactive GUI user command these actions;
with a regular form, he can drag the title bar, or drag one of the edges.
You can have one of the sizeable border styles with a minimal border by setting a lot of
bool properties false (MinimizeBox e.a.), and assigning an empty string as title.
That way the user can still drag the border to resize.
Without any border, you should provide something else to grab and drag, or otherwise command
it, your fantasy is the only real limit, but it won't correspond to the normal
Windows behavior and the "good GUI" guidelines. So you will end up setting a new
Form.Size value somewhere in a keyboard, mouse or button handler.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi Luc,
I use no borders form. I created a PictureBox as a resizing point and with mousemove, mouseup, mousedown events it works fine.
Thank you for help.
daavena
|
|
|
|
|
You're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi, I am learning managed c++ in visual c++ 2005 express, the code below will find files starting on letter x, my question is how can I copy them to some directory ex. C:\\XXX\\y ?. Thx
<br />
DirectoryInfo^ directory = gcnew DirectoryInfo("C:\\Documents and Settings");<br />
array<FileInfo^>^files=directory->GetFiles("x*.txt",<br />
System::IO::SearchOption::AllDirectories);<br />
for (System::Int16 i=0; i<files->Length; i++)<br />
textBox1->AppendText(files[i]->Name + "- " + files[i]->Length + System::Environment::NewLine);<br />
|
|
|
|
|
YOu might have better luck asking this in the (Managed) C++ forum.
|
|
|
|