|
thanks, now performance is better.
|
|
|
|
|
Have any of you created any custom additions to Microsoft's HTML editor control? I have a bunch of features I'd like to implement, including:
- locking of certain portions of an html page so that only specified blocks can be edited. When the user tries to do anything, for example, selecting text, clicking a table, etc, they'd simply get a "not allowed" cursor icon and clicking a locked area would have no effect.
- a vastly improved table editor! I'd like to implement a table editor similar that functions similarly to dreamweaver's table editor. Microsoft's table editor sucks. Various things would need to be overridden, i'd imagine, including how tables respond to various events (click, drag, drop, etc).
Have you ever attempted anything like this? I'd really like to know what the limitations of the html editor control are before I start to invest a whole bunch of time trying to do these things only to come to brick wall halfway through development.
Also, I'm open to making this free if anyone wants to help me. Naturally I'll be using C# and implementing it as a custom winforms control.
NATHAN RIDLEY
Web Application Developer
email: nathan @ netlab.com.au
[remove the spaces before and after the @ symbol]
|
|
|
|
|
What you want is possible, although not easy. You can host either the WebBrowser control or the MSHTML component through COM interop assemblies. The WebBrowser control hosts the MSHTML component and provides additional services you may want, like hyperlinking and additional communication with the host.
In order to extend it, you must declare managed interfaces like IDocHostUIHandler . These advanced hosting interfaces are documented in MSDN in the Advanced Hosting Reference[^]. If you want to generate an interop assembly for these interfaces, read the article Using MSHTML Advanced Hosting Interfaces[^] here on CodeProject.
If you don't want to go to all that work (because there's quite a bit involved), take a look at some of the third-party solutions out there. We just settled on the NET.RIX[^] component, which has both a full and lite version with what you want already. It's also affordably priced and royalty free.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Wow that NET.RIX control looks great! I think I'll go that way and save time. thanks
NATHAN RIDLEY
Web Application Developer
email: nathan @ netlab.com.au
[remove the spaces before and after the @ symbol]
|
|
|
|
|
I just found this great free control at http://www.skybound.ca/developer/visualstyles/[^]. Has anyone tried/tested it? Is it reliable enough for deploying? I'm a little worried since it used something similar to Application.EnableVisualStyles();
Anyway... it's definately worth a look and a try because it is an amazing piece of software!
Carl
|
|
|
|
|
how can i save an image to a directory that i want with out using SaveFileDialog.
Thanks
Rock Throught The Night
|
|
|
|
|
The SaveFileDialog is only used to get directory path and the filename where you want to save the image into. It does not save your image into the directory.
If you already know where to save the image, you can specify the path directly to your function that writes the image file.
Edbert P.
Sydney, Australia.
|
|
|
|
|
once more question: how to get the file extension.
Thanks
Rock Throught The Night
|
|
|
|
|
string ext = System.IO.Path.GetExtension(path);
Don't people read help files anymore
|
|
|
|
|
In C#, there is a function called GetExtension that can return
extension name of a file given the file path.
Here's a sample code:
string fileName = @"C:\mydir.old\myfile.ext";<br />
string extension;<br />
<br />
extension = Path.GetExtension(fileName);<br />
Console.WriteLine("GetExtension('{0}') returns '{1}'", <br />
fileName, extension);
Hope it helps
Edbert P.
Sydney, Australia.
|
|
|
|
|
Hi,
Ok Heath mentioned that I should call dataset.Merge after I get a returning dataset from Webservice. Well the Compact framework doesn't support Merge property. So what should I use instead in order to update dataset on client to reflect change in returned dataset ?
Thanks,
JJ
|
|
|
|
|
Merging is only necessary if you have two distinct DataSet . IIRC, this was your case.
I would recommend downloading a decompiler like .NET Reflector[^] and see how the Merge method works. It does use an internal class that wouldn't be available in the .NET CF, either, but you could duplicate the functionality in your project.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
If I am getting a dataset from a webservice on a different machine, couldn't I somehow clone the returned dataset back into the original dataset sitting on the client?
Design:
PDA client calls webservice sitting on other pc with database and IIS. I send dataset to webservice to have it update DB then return a dataset back to client.
Thanks,
JJ
|
|
|
|
|
A clone is a copy of the original, so how can you "hook it back up" to the original? As I said before, just merge the DataSet you get back with the one you have in memory using DataSet.Merge .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have written a PowerPoint Add-In and am working on the install package.
I created the setup project and am trying to set a registry entry to the location that the application is installed (whatever that may be).
I must do this to have access to the install directory as with COM add-ins all the application path properties in the Framework return *OFFICE's* application path, not my add-in's.
So in the registry part of the setup I have set several static values but also want to set one that is dynamic based on the install location.
Anyone know how to do this?
--Tony Archer
"I can build it good, fast and cheap. Pick any two."
|
|
|
|
|
First of all, if these add-ins are .NET assemblies, you can always get their path using Assembly.GetExecutingAssembly().Location , among a few similar ways.
To set the path in the install, though, set the registry value to [INSTALLDIR] (more than likely, if all your assemblies go into the same installation directory). There are much better ways but the VS.NET Windows Installer project doesn't make them possible without using a tool like Orca (from the Windows Installer SDK) and modifying the MSI package after it's compiled, which also requires some knowledge about MSI packages.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I was wondering if you could have a public structure with private/public objects within it? Like in this example
<br />
public struct ClientData<br />
{<br />
public Socket clientSocket;<br />
public Thread clientThread;<br />
private int clientMonitorID;<br />
}
or if you define it as public does object within become public
Yes, I program in VB6, but only because I use it to fill my addiction to having a dry place to sleep and food to eat!
|
|
|
|
|
Yes you can have a public structure with private and public objects in it.
The private objects will not be accessible from outside the struct, this can be used if for example you want to pass a value to the constructor of the struct and use it internally (do not want other objects to access it).
public struct ClientData
{
private int clientMonitorID;
public ClientData(int clientMonitorID)
{
this.clientMonitorID = clientMonitorID;
}
public int FunctionX()
{
FunctionX = clientMonitorID + 1
}
}
Edbert P.
Sydney, Australia.
|
|
|
|
|
Yes, as Elbert said, it is possible. I wanted to add that, like classes, you should actually declare public properties that reflect private fields in your structure. This not only gives you a chance to validate input (always a good idea) but also to invoke delegates if necessary since properties are just getter and/or setter methods. You can still do it with fields, but it's quite a bit more difficult.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I was wondering. Is there an easy way to dock a windows form? i have a scroller that I would like to place at the top or bottom of my desktop. I want it to dock so all the other windows resize to accomidate it. I know you can dock buttons inside the form with the dock property. I tried this.dock = DockStyle.Top; but it seems to have no effect on the windows form. Any suggestions would be great.
Win32newb
"Programming is like sex, make one mistake and you have to support it for a long time"
|
|
|
|
|
The best way is to create an AppBar - just like the Windows Task Bar and the old Office Shortcut Bar. See the article C# does Shell, Part 3[^] here on CodeProject.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I need to convert various datatypes (mostly doubles, bytes and strings) to byte array and then read it back. I need to read it the fastest way possible and it will be read thousands of times and written only once.
What I use now is BinaryReader/Writer like so:
MemoryStream stream = new MemoryStream()
BinaryWriter writer = new BinaryWriter(stream)
.. loop ..
writer.write(byte)
writer.write(double)
writer.write(string)
...
return stream.ToArray();
I don't care how fast writing is.
Then I need to read the data:
byte[] data = ...
MemoryStream stream = new MemoryStream(data);
BinaryReader reader = new BinaryReader(stream);
while (stream.Position < stream.Length)
{
byte b = reader.ReadByte();
switch (b)
{
// depending on value of b read strings, doubles or bytes
}
}
This approach doesn't seem to be too fast. I'm wondering if there is a faster way to do that.
Thanks.
|
|
|
|
|
See the BitConverter class documentation in the .NET Framework SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Dear forum members,
An object of a managed class (written in C#) is passed to the
clipboard during drag&drop operation. The object has to be
dropped on to a MFC view (written in VC++ .Net).
How do I create/access my object from the COleDataObject
which I get while 'Droping' into a view ?
Is there any other way to do this ?
[Hope I have explained my problem well ...]
Thanks in advance.
svkr.
|
|
|
|
|
This gets into marshaling. You can't just send a managed object through the clipboard (unless you exposed it as a CCW, or COM-Callable Wrapper) and used the interface re-declared (with the necessary GUID, or IID) in unmanaged code. The easiest way is to marshal the object so that it has a well-known representation, whether thats the fields packed into a byte[] array or whatever. You can also use the Marshal class to assist with this.
Those are really the only two ways to do this and marshaling would probably be the best way since it doesn't rely on COM and exposing your object (and all child objects that you must access) as CCWs.
Marshaling also means you can drag and drop your managed object to something that doesn't provide COM programming but instead abstracts drag and drop and provides you the data. With a well-known structure, you can marshal the data back to a representative object. One example would be a scripting language like JScript or VBScript. While you could expose your object as a automation-compatible (i.e., IDispatch implementation) CCW, this requires some knowledge of automation types and automation itself.
Microsoft MVP, Visual C#
My Articles
|
|
|
|