|
what it should do (if you change the mdiChild to it's correct name MDIChild) is assign the current form as mdiparrent to the MDIChild form.
maybe the names confuse you. here is a better example:
<br />
Form P = new Form();<br />
Form C = new Form();<br />
P.IsMdiContainer = true;
C.MdiParent = P;
P.Show();<br />
C.Show();<br />
bare in mind that once a from is a mdiChild it cannot be a MdiParent as well(as in you can't have a mdi form inside an mdiform). In the above example if you set C.IsMdiContainer = true; an exception will be raised.
|
|
|
|
|
|
hi,
i included a mainmenu with a few menuitems into my project.
when i now drag the mouse over the menuitems in the mainmenu their background changes to a dark blue. what event is called to do this? i want to paint my own background when the user moves the mouse over the items. all i found was the select event, but this one is only fired when the user clicks on one of the menuitems. there should be another one, e.g. like mouseover. can't find it anywhere.
does anyone knows what event is fired when the user drags the mouse over a regular menu?
thanks for help
pikebu
|
|
|
|
|
Try using the Popup event which is fired before a menu item's list of menu items is displayed. Use it for the "parent" menu-item.
|
|
|
|
|
Hi Pikebu,
The MenuItem.Select event IS raised when the user hovers their mouse over a menu item. However, I don't think this will help you.
You need to set the MenuItem.OwnerDraw property to true , and then handle the DrawItem event (which is only raised when if OwnerDraw == true ). In the DrawItem handler, you can draw your own rectangle, change the colour and font of the text, etc.
see MSDN here... MenuItem.DrawItem event[^]
Hope this helps,
Gary Perkin.
|
|
|
|
|
the problem is, that the select event is only raised, when i click on the mainmenu and then move the mouse over the menuitems. only dragging the mouse over the menuitems in my mainmenu doesn't raise the select event.
i set ownerdraw to true and implemented my own code to draw all items. it's working fine for all items, which are in a submenu. the problem is only with the menuitems on the mainmenu.
|
|
|
|
|
Hi,
You're right! Sorry, I misread your original post
It's an interesting question...
Gary.
|
|
|
|
|
ha, figured it out!
you have to check for the state in the overwritten OnDrawItem method.
the state which is true when the user moves the mouse over the menuItem without clicking is called HotLight. with a mouse click the state changes to Selected.
|
|
|
|
|
Hi,
That's a bit freaky! I just posted the same solution!
Does this count as Pair Programming???
Glad you sorted it.
Gary.
|
|
|
|
|
Hello again,
Just did a bit of experimenting...
I set OwnerDraw = true on a MainMenu MenuItem, and in the DrawItem handler I output e.State to a listbox. When the mouse entered the menuitem, the state was "HotLight, NoAccelerator", but when it left, it was "NoAccelerator" This will let you determine if the mouse is entering or leaving, and nobody needs to click anything.
Not sure if this helps or not - you'll have to draw your own MainMenu items (you may already be doing this).
Good luck!
Gary.
|
|
|
|
|
|
Hi,
How to hide modal dialog box when I call function InternetDial from WinInit.dll?
Thanks!
|
|
|
|
|
Hi all,
How do I know what language (VB, C#, J#, etc.) a web Project is?
Also, how do I know what type of project (Class Library, Console Aplication,
Web Project) it is?
Regards,
Rathish P S
|
|
|
|
|
If you are using visual studio ,then you will find the project file contains the language in it's extention like *.csproj , and *.vbproj.
|
|
|
|
|
I am using VS 2005 and for web projects, there is no .vbproj or .csproj in 2005. We can't use this method. Only way is some how findout the language used from the web.config file, since now all are maintaining in web.config file. Also I want to know it programmatically using EnvDTE or some objects like that. Can you help me?
Regards,
Rathish P S
|
|
|
|
|
Extension of project will tell you its type like if its abc.dll it means its a class library, or if its abc.exe its a console application.
Regards,
Ali
Ali
http://aliwritings.blogspot.com/
|
|
|
|
|
Yes, you are right. But I want to know it by using C# code. Currently I am using object of EnvDTE.Project to find it. But for webprojects, we can't follow this method since no project file in VS 2005. I want to solve this issue. If you have an idea about the solution please help.
Regards,
Rathish P S
|
|
|
|
|
In win application you can open the .sln file with the notepad and you will get there the language .
In web application there is no real deffirence between vb.net and C# ,cuz they are in html ,And if you want to know the language as a code behind file then :
It will be either *.aspx.cs OR *.aspx.vb .
|
|
|
|
|
u mean that we can do it by parsing the solution file. Am I right? I have to find out the code behind language by using C#. Now I am doing it by anylysing the extension of project.ie .vbproj or .csproj. But the real problem is that web projects in vs 2005 do not have project file. Infact all are storing in the web config file. We can use this file for parsing and identify the language. But i am trying to found out more easier way to solve this.
Thanks
Regards,
Rathish P S
|
|
|
|
|
I think this maynot be a slight big problem ,since .net 2.0 allows any web project to be in multible languages.
|
|
|
|
|
hi ..
i hav an application , i want if i enter roll no in a textbox and then click button then corresponding name of that rollno will show in other textbox..
i want to do this using dataset when dataset is filled with table "stdrecord"..
|
|
|
|
|
What I understand is user can type some text in a text box and now on click of some button, same text should go in some other text box.
Suppose Textbox1 is first textbox and Textbox2 is second, then on click of button, you only have to write this;
Textbox2.text = Textbox1.text;
Thats it!!!
and in which context are you talking about dataset... please elaborate...
Ali
http://aliwritings.blogspot.com/
|
|
|
|
|
Hi,
so if that was the case ..initially fill the dataset with the desired format ..like for the above case ..fill with number,name,.,,.etc etc
and in textbox leave event handler write the code to traverse inside the dataset and if the match found for number get the corresponding name and fill the desired text box
i hope u got!!!
With Regards,
Vinayaka Shenoy
|
|
|
|
|
I am trying to insert a NULL value into a table but don't know how to do it? Any suggestion?
|
|
|
|
|
You can use DBNull.Value for this.
mav
|
|
|
|