|
Christian Graus wrote: I assume one of those 'form2' instances should be 'form1'.
You're right - I was so busy trying to make some sense of his post.
|
|
|
|
|
*grin* I think you proved your point about sensible variable names but.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: I think you proved your point about sensible variable names but.
Yup - I should practice what I preach.
|
|
|
|
|
Hi every body
I m looking for .net Datagrid component i know that is already available in Window Forms but it is not flexible as that one is in ASP.Net 1.0
so any body can reffer me any link for free DataGrid should be easy to use/integrate in WinForms ; will be best if 100% same as of ASP.Net
|
|
|
|
|
Hi ,
I`ve just hit an interesting roadblock in my app & would really appreciate any help / feedback. The "bug" can be replicated easily.
Basically, I have 2 forms running as 2 different processes , say Form X & Form Y.
Their properties are :
Form X : ShowinTaskbar = true , FixedToolWindow , Maximized.
Form Y : Showintaskbar = false , Borderstyle.None , Normal
We have methods on Form Y that can be invoked via Remoting to do Show(owner) , usually Form X ends up being the owner here. I`ve impleneted the IWin32Window interface and initialise it with my Form X`s handle (obtained via FindWindow)
The issue is that Form Y can NEVER retain focus (say when u click on a text box in it) and focus always gets transferred to the owner Form X. I`m not really setting an Owner / Owned relationship between them formally, say , via AddOwnedForms in Form X or Form.Owner = FormX since i guess this doesnt work across processes.
If we change the ShowInTaskbar property of Form X to false , or Form Y to true then there is no problem with the Focus.
Can someone please suggest where i`m going wrong or if theres any other action i need to do ? I dont really understand how the ShowinTaskbar property is affecting the focus mechanism , or whether this is how windows itself works.
So far i`ve tried doing a Activate() , Focus() & BringtoFront() in Form Y but it doesnt work.
SetParent isnt an option since it couples together their lifetimes i.e. if child crashes parent also crashes.
Thanks in advance
|
|
|
|
|
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
|
|
|
|