|
That's not really what you asked for, though.
If you want a good implementation, see the IPropertySheet documentation in the Platform SDK on http://msdn.microsoft.com[^]. For example, I use a implementation similar to the following in our application:
public interface IPropertyPage
{
string Title { get; }
void Save();
void Cancel();
event PropertyChangedEventHandler PropertyChanged;
} Implement this type of interface on your control. Then create a PropertySheet class that allows you to add IPropertyPage implementations to it. When you call ShowDialog on your PropertySheet (should derive from Form ) it has all the pages in a TabControl . When the event is fired, enable the Apply button. When Apply or Save is clicked, call Save on each IPropertyPage in your collection and close the dialog if Save was clicked (it annoys me to no end when people click Apply then OK since OK is supposed to apply changes and close and - with all Microsoft implementations - does).
This is very similar to how MFC and the Windows Shell interfaces do it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello again!
That's exactly what I was looking for!
Thanks for your time
Pedro
|
|
|
|
|
Hi All,
I have a Windows Forms app with a treeview control. I'm trying to add a 'Rename' command to the context menu. The event handler for the context menu looks like the following:
private void cmMTRename_Click(object sender, System.EventArgs e)
{
if (tvModelTree.SelectedNode != null)
tvModelTree.SelectedNode.BeginEdit();
}
The node goes into edit mode but the context menu stays visible. Is there a way to hide the context menu prior to putting the node into edit mode?
Thanks,
Chris
|
|
|
|
|
I was outsmarted by the tree control.
I was handling the MouseUp event to display the context menu. It seems the treeview already does this for me so I was displaying it a second time.
Thanks.
Chris
|
|
|
|
|
I've created an MSI installer with VS.NET 2003 which runs great. I've created two file type associations. The association is made, but when I right click on the associated file and view the proerites I notice something strange. The "File Type" information is correct = "My Prog File"
but the "Opens with:" data is not correct, it just shows the program icon and not the name. I've tracked it down to a registry entry:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\MUICache]
There is a registry string in there called:
"C:\Program Files\MyCompany\MyProgram Folder\MyProgram.exe"
the value for this string is blank. When I assign the value of "MyProgram.exe" to the entry, the associated file property page now reflect both the program icon and name in the "Opens with:" area.
Does anyone how this getts filled in ? Am I missing some kind of description property in my assemby ?
Any thoughts on how to fix this would be very much appreciated.
|
|
|
|
|
I figured it out...I was filling inthe AssembyInfo.cs attribute sections.
|
|
|
|
|
glad you sorted it! :p
-------------------------------------------------------
looking for hosting? ithium is good.
|
|
|
|
|
Absolutely *love* the name
You should see my office at home...I've got damn near the whole collection of the old-style Guinness posters up.
|
|
|
|
|
Everyone loves a Guinness, or should.
|
|
|
|
|
Hi'
i'm using a graphical list view name 'GlacialList' and its realy very good.
i need to put an image on my scroll bar, does anyone know how can i do it?
did someone take care the scroll bar events by itself?
|
|
|
|
|
|
Hello,
I am creating a toolbar for IE, almost like google toolbar. I want to give options for websearching, save current web page, and it should cofigurable from XML. I created a toolbar and it is visible in my IE, but I am struck in websearching part. Anybody please help me or give me the tips, how google and yahoo searches the web from its toolbar,and how can I implement it. please help me.
Thanks in advance for your time.
|
|
|
|
|
Are you asking about how to make the toolbar work? Or, what URL to send searches to? The latter is very easy: Just go to the search engine you want, type in something simple like "test". Then, after that gets submitted, copy the URL and replace the value you used with the search query. For instance, Google's would be: "http://www.google.com/search?q={0}".
Michael Flanakin
Web Log
|
|
|
|
|
how can i convert code from VB to C#:
( i am new to c#)
Public Function GetHiWord(ByRef lparam As Integer) As Integer
' This is the HIWORD of the lParam:
GetHiWord = lparam \ &H10000 And &HFFFF
End Function
Public Function GetLoWord(ByRef lparam As Integer) As Integer
' This is the LOWORD of the lParam:
GetLoWord = lparam And &HFFFF
End Function
Thanks
|
|
|
|
|
I believe this is right:
public int GetHiWord( int lparam )
{
return lparam \ (0x10000 & 0xFFFF)
}
public int GetLoWord( int lparam )
{
return lparam & 0xFFFF
} Michael Flanakin
Web Log
|
|
|
|
|
I think it should be
GetHiWord(ref int lparam)
and
GetLoWord(ref int lparam)
since the value is being passed by reference rather than value type.
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
You're right. The only reason I didn't do that was because nothing was done with the value. I figured that, if it wasn't being changed, then there wasn't a reason to have the reference. I may be wrong tho.
Michael Flanakin
Web Log
|
|
|
|
|
But the VB code is also returning an Integer (it's a function, not a sub). IMO, the original VB code was flawed since it was taking an Integer reference but still returning a separate Integer without actually modifying the parameter value (hence, no need for ByRef and should've been ByVal instead).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks,
There is no \ in c#
so i guess i should do:
public int GetHiWord( int lparam )
{
return lparam / (0x10000 & 0xFFFF); // or ? return lparam / 0x10000 & 0xFFFF;
}
public int GetLoWord( int lparam )
{
return lparam & 0xFFFF ;
}
|
|
|
|
|
You're right. Good catch.
As for whether or not to use parens, I'm not sure which operator will execute first. I would suggest using the parens for clarity, just to make sure the point gets across.
Michael Flanakin
Web Log
|
|
|
|
|
Hi.
I'm new to the Sharepoint portal server 2003 (or any other sharepoint for that matter) and I need to get to know how to develop stuff for it.
I've messed around a bit with building webparts and now I want to know how to make custom lists.
However i'm having trouble finding any good rescources on the subject.
Is there anyone here that can point me to some good forums/guides/tutorials/SDK's/etc. ?
p.s. I have been through MSDN and I don't seem to be able to find anything other than developing webparts there.
|
|
|
|
|
troels_sorensen wrote:
I have been through MSDN and I don't seem to be able to find anything other than developing webparts there.
And you won't...yet. There will be better WebPart support in .NET Framework 2.0 to be released in the beginning of 2005 (SQL Server "Yukon" is holding it up).
We've been working with it here and some associates upstairs in our complex use it as the base for their product as well. We all contend that the documentation - for what little there is - sucks for SharePoint.
For one, when you install SharePoint Services on your Windows Server 2003 box, you have to manually copy the Microsoft.SharePoint.dll assembly to your development box. Some SDK, huh? Examining that with ildasm.exe that comes with the .NET Framework SDK is definitely handy, or use a good decompiler like .NET Reflector[^].
You should also check out http://www.sharepointcustomization.com/[^]. It's not the greatest, but it does have examples.
Finally, get yourself a copy of FrontPage 2003. Now, I'm not big on WYSIWYG editors, but FP 2003 is a vast improvement - event for HTML editing capabilities - over previous versions. It also specifically targets SPS with a lot of great support. It's well worth it, IMO.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Yeah... documentation.... guess I'll just have to guess then, since microsoft wants it that way.
Looking forward to the new version!
Thanks for the link.
|
|
|
|
|
I'm developping an application where I need to serialize objects. But the properties of these objects may change during the developpment as I could add new options.
For instance, I may have this
class Car
{
// version1
string ModelName;
int Speed_Mph;
}
And then I want to serialize an array of Car into a binary file (foo.sav)
Later, I add the color :
class Car
{
// version1
string ModelName;
int Speed_Mph;
// version 1.1
string Color;
}
Now, if I try to used the deserialization function with foo.sav, it won't work, because foo.sav didn't contain the Color properties for Car.
What is the easiest / msot efficient way to solve it?
I have several ideas in mind, but I don't know the better ones.
The most efficient one seems to be to write my own ISerializable interface, and start by reading the version. It works, but I'm afraid it's a lot of work, as I need to assign the keys one by one, needn't I?
|
|
|
|
|
One way would be to implement the ISerializable interface and take these things into account yourself. Another way - especially if your assemblies are versioned (or better yet, strongly named) - is to extend the SerializationBinder and override BindToType so that when an older Type (since a Type name includes not only the fully-qualified class name but also the assembly information) you bind it to your new Type. You'd still have to take into account any changes, but this is a common and pretty efficient way of solving the problem of versioning. See the documentation for the SerializationBinder method in the .NET Framework SDK for more information and an example.
Microsoft MVP, Visual C#
My Articles
|
|
|
|