|
Hey Howzit?
I was astonished to see that a person can't override or set a Panel's "LOCKED" property, how can I get around this?
Regards,
|
|
|
|
|
hi NewbieDude!
actually, this is not a property of the panel. it's coming from the ToolBoxItem class.
Anyway, if you want is to set the allowable selection on your panel (the icons to resize/move a panel in design-time), you must sub class the Windows.Forms.Design.ParentControlDesigner then override the SelectionRules property. In that property, you can set what selections are allowed.
then use this designer on your customized panel by adding a Designer attribute on you panel.
public class MyDesigner : ParentControlDesigner
{
public MyDesigner ()
{}
public override SelectionRules SelectionRules
{
get
{
return (SelectionRules.Locked | SelectionRules.Visible | SelectionRules.Moveable);
}
}
}
[Designer(typeof(MyDesigner))]
public class MyPanel : Panel
{
public MyPanel ()
{}
}
hope that helps!
microsoc
|
|
|
|
|
Hi there,
I have created the new class MyDesigner using your code and created and then I have placed the attribute above my class but I am not familiar with all this, how do I actually lock the panel now?
|
|
|
|
|
at design time, try to select your panel. haven't you notice that the selection is the same as when you set the lock property to true? you cannot resize it through dragging.
if it's not what you want, can you elaborate more what you trying to do?
thanks!
microsoc
|
|
|
|
|
Hey, I am hosting windows forms designers (see the link below which has the code). In other words this application simulates .NET design time when its actually in run time. So all the rules change are far as properties etc.
After you have checked out the code, what I wanna do is create a Panel in code, add it to this form (which is instantiated in the initialize method) and then LOCK the panel.
http://www.divil.co.uk/net/articles/designers/hosting.asp
|
|
|
|
|
I took the MOVEABLE property out...IT WORKS>>>>YOU'RE THE MAN!
|
|
|
|
|
ok. I added that because i thought you only want to lock the resizing part.:->
anyway, nice to know that!
happy coding!
microsoc
|
|
|
|
|
I 've created my html editor and now I want it can merge selected table cells.
I use HtmlSelection.createRange() to get HtmlTextRange then use HtmlTextRange.pasteHTML to replace cells' html but it do not work.
Can anyone suggest me some code to do this?
|
|
|
|
|
hi ....
im workin on a windows app.... i want to list my contents in detail...
like i wanna display the name, size, type and last modified ...
i've got the rest how to get the type of the file used....
for eg: if a folder is choosed the type for it is file folder
i dont want the extension to be displayed as the type i want the real type of the file used....
im tryin with fileinfo object ... am i missing any thing specific....
imsathy
|
|
|
|
|
If you suspect the extension could be wrong, then you need to parse the file. Which means writing code for every file format you want to support.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
can u tell me how to get the file details
sathy
|
|
|
|
|
*sigh*
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
*grin*
I try to answer whatever I can, but don't meet with much success as I'm a tyro myself; but I do see most of your replies. I really feel for you when you get such questions.
Cheers,
Vikram. "Don't judge me
You could be me in another life
In another set of circumstances"
- "Tomorrow we'll see", Sting.
|
|
|
|
|
Hi!
Could it be that your question has been misinterpreted?
Do you want to determine the type of file from the contents of the file because you don't trust the extension (like CG suggested) or do you want to display the name for a given extension like Windows Explorer does (for example: extension is ".txt", but explorer shows "text file")?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
mav.northwind wrote: want to display the name for a given extension like Windows Explorer does (for example: extension is ".txt", but explorer shows "text file")?
this is exactly wat i want!!!
sathy
|
|
|
|
|
That's an information you get (along with the icon associated, btw.) from a call to SHGetFileInfo from shell32.dll.
Take a look at this article[^], it holds all the information you need.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
mav.northwind wrote: That's an information you get (along with the icon associated, btw.) from a call to SHGetFileInfo from shell32.dll.
i dont want icon inforamtion tht i have already done.
wat i want is if a "test.doc" file is selected i want the type as Microsoft Word Document
the details for this one is in shlwapi.dll
but the same is working for me in vb.net but i want it in c# .. its not working
sathy
|
|
|
|
|
The information you want is simply the szTypeName member of the SHFILEINFO struct. When you read the documentation for SHGetFileInfo you'll see that you'll have to specify the SHGFI_TYPENAME flag to query this piece of information.
It's all in the documentation, you just have to read...
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
thanx a lot for the idea... mate
sathy
|
|
|
|
|
I'm working on an app that's using the WebBrowser control in a c# windows application.
I got the control working fine, hooking to the document object. But I've run
into a major issue with hooking the Document events. Whenever I hook any of
the HTMLDocumnetEvent2_Event events like this:
HTMLDocumentEvents2_Event DocEvents = this.Browser.Document as
HTMLDocumentEvents2_Event ;
DocEvents.oncontextmenu += new
HTMLDocumentEvents2_oncontextmenuEventHandler(Browser_ContextMenu);
the browser document becomes unresposinve.All mouse clicks are eaten. I cannot click on any text box or any link . But the right click is disabled . Can anyone help to solve this problem such that i can disable the right click in the browser control and browser document and mouse clicks also work fine in c# windows application.
thanks
ramya
-- modified at 23:34 Monday 27th February, 2006
|
|
|
|
|
Hi Ramya,
The System.Windows.Forms.WebBrowser control has a public property IsWebBrowserContextMenuEnabled. Set this boolean to FALSE, so the Context menu would not be displayed.
BTW, just as a passing reference, do remember that context menu can also be displayed using the keyboard. So setting this property of webbrowser would take care of both the 'Keyboard' and 'Mouse - Right click' related ways of displaying the context menu.
Regards,
vinSharp
There are two kinds of fools in this world: One who give advice and the others who do not take it...
|
|
|
|
|
I would like to integerate outlook style dropdown list in my application. I have not found any control having exactly same functionality as in outlook dropdown used for the To, CC fields in new message window.
I used combo dropdown to filter the rows as user types in the textbox. The filtering functionality is working fine but when I use UP/DOWN arrow keys the selected text comes into the textbox which I don't want.
Is there any way which will not assign the selected text in the dropdown textbox when user navigate in the dropdown list using UP/DOWN arrow keys?
Any help is greatly appreciated.
Thanks
Nitin
|
|
|
|
|
hi friends.
i am currently developing an application which consists of two major parts.these are the desktop application and the web version of the same. both have to interact with the same database kept on webserver. i am unable to connect a desktop application with a database kept on webserver. has anyone done this? i shall be highly oblidged if you could solve my problem.
deepak rajan
|
|
|
|
|
Is it a database server you are trying to connect with or a file like an access database?
Wacky waving inflateable arm flailing tube man!
- Family Guy
|
|
|
|
|
ya dear its a databse server. i am using sqlserver. can i connect my desktop application built in c# with sqlserver kept on webserver. please write with code.
deepak rajan
software developer
lucknow, India
|
|
|
|