473,785 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

No MDI borders?

I'm trying to create an MDI form where the MDI area dosn't have the
traditional 3D borders. I thought at one point the code I had in the form
constructor was working, but now I'm getting an MDI without borders, but the
main menu on my form no longer appears. Anybody who has a little more
experience with this and is willing to help, I would appreciate it.

Thanks,
Jacob

// In MDI form constructor, after InitializeCompo nent.
for(int i = 0; i < this.Controls.C ount; i++)

{

mdiClient = Controls[i] as System.Windows. Forms.MdiClient ;

if(mdiClient != null)

{

// Get Styles using Win32 calls

int style = Win32.GetWindow Long(mdiClient. Handle, Win32.GWL_STYLE );

int exStyle = Win32.GetWindow Long(mdiClient. Handle, Win32.GWL_EXSTY LE);

// Remove any borders on the Mdi.

style &= ~Win32.WS_BORDE R;

exStyle &= ~Win32.WS_EX_CL IENTEDGE;
// Set Styles using Win32 calls

Win32.SetWindow Long(mdiClient. Handle, Win32.GWL_STYLE , style);

Win32.SetWindow Long(mdiClient. Handle, Win32.GWL_EXSTY LE, exStyle);

break;

}

}
Nov 16 '05 #1
2 8845
Well, I think I got it figured out. When the code is placed in the
constructor it fails because the form and hence the MdiClient have not
gotten bounds yet. Without bounds, the function treats the whole form as the
mdi area, leaving no room for the menu, and that is what is causing the menu
to disappear.

Just put the code in the load event or other appropriate spot.

Jacob

"Jacob" <ja**********@R EMOVETHIShotmai l.com> wrote in message
news:uM******** *****@TK2MSFTNG P11.phx.gbl...
I'm trying to create an MDI form where the MDI area dosn't have the
traditional 3D borders. I thought at one point the code I had in the form
constructor was working, but now I'm getting an MDI without borders, but the main menu on my form no longer appears. Anybody who has a little more
experience with this and is willing to help, I would appreciate it.

Thanks,
Jacob

// In MDI form constructor, after InitializeCompo nent.
for(int i = 0; i < this.Controls.C ount; i++)

{

mdiClient = Controls[i] as System.Windows. Forms.MdiClient ;

if(mdiClient != null)

{

// Get Styles using Win32 calls

int style = Win32.GetWindow Long(mdiClient. Handle, Win32.GWL_STYLE );

int exStyle = Win32.GetWindow Long(mdiClient. Handle, Win32.GWL_EXSTY LE);

// Remove any borders on the Mdi.

style &= ~Win32.WS_BORDE R;

exStyle &= ~Win32.WS_EX_CL IENTEDGE;
// Set Styles using Win32 calls

Win32.SetWindow Long(mdiClient. Handle, Win32.GWL_STYLE , style);

Win32.SetWindow Long(mdiClient. Handle, Win32.GWL_EXSTY LE, exStyle);

break;

}

}

Nov 16 '05 #2
Oh ya, you'll need to force the MdiClient to be recreated. Placing this
directly after the first snippet is one way.


Win32.SetWindow Pos(mdiClient.H andle, IntPtr.Zero, 0, 0, 0, 0,

Win32.SWP_NOACT IVATE | Win32.SWP_NOMOV E | Win32.SWP_NOSIZ E |
Win32.SWP_NOZOR DER |

Win32.SWP_NOOWN ERZORDER | Win32.SWP_FRAME CHANGED);



"Jacob" <ja**********@R EMOVETHIShotmai l.com> wrote in message
news:uM******** *****@TK2MSFTNG P11.phx.gbl...
I'm trying to create an MDI form where the MDI area dosn't have the
traditional 3D borders. I thought at one point the code I had in the form
constructor was working, but now I'm getting an MDI without borders, but the main menu on my form no longer appears. Anybody who has a little more
experience with this and is willing to help, I would appreciate it.

Thanks,
Jacob

// In MDI form constructor, after InitializeCompo nent.
for(int i = 0; i < this.Controls.C ount; i++)

{

mdiClient = Controls[i] as System.Windows. Forms.MdiClient ;

if(mdiClient != null)

{

// Get Styles using Win32 calls

int style = Win32.GetWindow Long(mdiClient. Handle, Win32.GWL_STYLE );

int exStyle = Win32.GetWindow Long(mdiClient. Handle, Win32.GWL_EXSTY LE);

// Remove any borders on the Mdi.

style &= ~Win32.WS_BORDE R;

exStyle &= ~Win32.WS_EX_CL IENTEDGE;
// Set Styles using Win32 calls

Win32.SetWindow Long(mdiClient. Handle, Win32.GWL_STYLE , style);

Win32.SetWindow Long(mdiClient. Handle, Win32.GWL_EXSTY LE, exStyle);

break;

}

}

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3464
by: Hostile17 | last post by:
I've been trying to figure out a good way to make a CSS layout with nice-looking 1-pixel borders around the table cells. The only broadly compatible way to do this I know of is to have * the border of the table set to zero * the cellspacing of the table set to one * the background color set to black * the table cell background color set to white
2
2420
by: Haines Brown | last post by:
This may seem a pointless question, but I'm trying work around an inconsistency between browsers. I have a template that contains a division that holds a text that sometimes exists and sometimes not. I use top and bottom borders to separate this material from its environment: .header { font-size: smaller; border-bottom: solid black thin;
1
2723
by: Melissa | last post by:
A form in my database has multiple subforms. If any subform has no data, the borders of the subform still display on screen and also are printed if I print the main form. Reports are different. If a subreport has no data, the borders of the subreport do not appear in Print View nor do they print with the report. I need the borders to print whether the subreport has data or not. Is there any way to get the subreport borders to print when a...
1
1744
by: Melissa | last post by:
Sorry if this becomes a repeat! I am having trouble with my newsreader and don't know if this got posted yeserday or not or if anyone responded. A form in my database has multiple subforms. If any subform has no data, the borders of the subform still display on screen and also are printed if I print the main form. Reports are different. If a subreport has no data, the borders of the subreport do not appear in Print View nor do they print...
1
5848
by: Glen Vermeylen | last post by:
Hi, For a project at school we have to automate the assignment of seats in classrooms to students during the exams. The lady who previously did everything manually kept the layouts of the classrooms in an excel-document: 1 sheet per classroom, and she marked the cells which represent the seats with a border. The problem however is that she sometimes merged cells together to get a better layout.
10
7738
by: Matt Kruse | last post by:
See: http://www.mattkruse.com/temp/offsetleft.html It appears that the offsetLeft value in IE6 (other versions not tested) incorrectly ignores the border width on a DIV when there is a width: property specified. Without a specified width: it gets it correct. Does anyone know 1) If this is a known bug, and if it affects any other browsers? I tested a few and found no problems.
7
9700
by: steve | last post by:
Hi All I urgently need help on setting datagridview cell borders at runtime I found some code on the web from Programming Smart Client Data Applications with .NET 2.0 by Brian Noyes See below This is what I have been trying to achieve, but when I run it ALL the cell
2
4614
by: cbjewelz | last post by:
Hey. I'm creating a horizontal boxed CSS menu for my site using lists. I wish to achieve a main menu bar something like this: http://kurafire.net/log/ however when I add borders to my code it adds the borders of each li so I get double thickness borders. I only want 1px so its a problem. here is my code: <style> #underlinemenu{ margin: 0; padding: 0;
9
2930
by: Michael Redbourn | last post by:
Hi, I just switched from FP to DW and am very very happy ! So whilst I'm mastering Dreamweaver (gonna be a while yet :-) - I thought that I'd try and find out how to add borders for browers like Firefox which don't support them. Not sure if I've explained the above well but my borders display in IE but not in Firefox.
2
30962
by: nicstel | last post by:
Hello, I'm trying to find documentation about the xlwt (py_excelerator). I want to change the border of some cells. But the only types that I found is: double and dashed. How to do a simple line and what is the all other border type name? "borders: top double, bottom double, left double, right double;" Thank You Nicolas
0
10157
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9956
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8982
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.