|
Hello,
You should take a look at the DesignMode property of the WebBrowser Control.
If you switch it to "on" it turns the WebBrowser Control into a WYSISYG (What You See Is What You Get) editor.
Then you can get the HTML from the WebBrowser Control.
Check out this great article on how to use the WebBrowser Control
Using the WebBrowser control in .NET[^]
|
|
|
|
|
my friend thank you for ur reply
but i need a html/text editor like gmail editor for writting message but with bit different and the different is that i want use this html/text editor in my windows application project.(c#.net)
in this article i didnt see some place for input html source or editing source with toolbar menu like office
are u sure that this article is usefull for me?
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
The article will show you how to place the a WebBrowser control onto your form, and it shows you how to switch DesignMode "on".
After that all the other functionality (i.e. editing source with toolbar menu like office) you would have to build yourself.
You can access the complete HTMLDocument by using the Document property on the WebBrowser control then use that to insert elements from your menu.
More info on the WebBrowser: http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx[^]
|
|
|
|
|
thank you for ur reply
i am going to test it !!!
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
Hi Friends,
I need to know that, is it possible to print '"' on the Console? I try to do this by this code: System.Console.WriteLine(""");
However, this doesn't work because declaring a single " marks the beginning of the string and declaring another " marks the end. Whatever be it, please tell me whether its possible to print (") on the screen? {excluding the () brackets}
Cheers,
Rajdeep.NET
I calculate my days on earth..... approximately 55 years remaining for me to expire
|
|
|
|
|
Yes it is, simply do
System.Console.WriteLine("\"");
|
|
|
|
|
Thanks Vestras,
It worked!
I calculate my days on earth..... approximately 55 years remaining for me to expire
|
|
|
|
|
|
|
I'm trying to roll up some old (originally .net 1.1) abstract classes into generics. The classes in question all provide similar functionality for a data object of a specific type. For the most part things are going well, but I've ran into a few places where one one of the data objects is of a type that needs extra processing in one method beyond what all the other types need. I can check the type of T to see if it's the type I need to do the special processing for, but the cast from T to SpecialType won't compile. Is there a different way I can do this, or is what I want to do impossible?
class MyGenericClass<T> : ICloneable where T: class, new()
{
private T m_storedClass;
...
private DoStuff()
{
if (typeof(T) == typeof(SpecialType))
{
((SpecialType)m_storedClass).SpecialString = "foo";
}
}
The European Way of War: Blow your own continent up.
The American Way of War: Go over and help them.
|
|
|
|
|
I am working on a C# application which accepts users information including their photos. So can you tell me the code how to store this photo in a data base......................... in the database there is a table called Personal ..................... and there is a column called photo(its data type is Image) which helps me to save a picture .............. Help me please........ Thank you
|
|
|
|
|
There are hundreds and hundreds of solutions to this problem on the web just search for save image to database c#.
To narrow the search a little replace 'database' in the search term by the name of the database you are using e.g.sqlserver.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hello,
I am new to C#. I would like to read a line of data which contains several items separated by spaces, e.g.
10 20 30
In C++, I would accomplish this by infile>>num1>>num2>>num3
However all of the examples I have seen in C# are for reading an entire line of string data.
Any help would be appreciated.
|
|
|
|
|
It really depends on the exact format of your data, but if your example is an accurate representation, then two approaches spring to mind.
1) as the examples you have seen do, read an entire line into a string (call it dataString ), then
string[] numbers = dataString.Split(' ');
foreach (string s in numbers)
{
someIntVariable = int.Parse(s);
}
2) BinaryReader has a ReadInt32() method. Which can be used, for binary streams, obviously.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thank you so much it worked.
|
|
|
|
|
Hi all,
I have an MDI window with a ButtonBar (defined as master) and from there I can call the child windows (outside the master).
And from one child window I am calling an DialogWindow.
And here comes the problem:
When I am closing this dialog window, the FormClosing event (of the dialog) fires 34 times, and after that the FormClosed event fires 10 times.
I am shure that the events are only initialized for one time.
So you can say that 3 layers are opened. (MDI-Master --> MDI-->Slave --> DialogForm)
It wouldn't be a problem at all, if the dialog window wouldn't hang up. The whole Program stops.
in the FormClosing method is only a quiet simple code.
Dialog_FormClosing(.....)
{
try
{
Console.WriteLine("closing");
if(!can_close)
{
Messagebox.Show("You have to finish your app first");
e.Cancel = true;
}
else
{
e.Cancel = false;
}
}
catch
{
}
}
The question is: Why fires the event so often ?
And why hangs up the dialog (the dialog does not close)
Some ideas ? - using .NET 2.0.xxx
Tnx
Frank
|
|
|
|
|
After I call DoDragDrop, the MouseUp event does not fire. I spent some time Googling this and I see that other people have noticed this behavior.
Here's my code. Anyone know what to do about this?
Thanks
public delegate void SpliiterMovedEventHandler(object sender, SplitterMovedEventArgs e);
public partial class _Splitter : UserControl
{
private bool _bDragging = false;
private int _OldPosition = 0;
public _Splitter()
{
InitializeComponent();
_OldPosition = this.Top;
}
public event SpliiterMovedEventHandler SplitterMoved;
protected void OnSpliiterMoved()
{
if (SplitterMoved != null)
{
SplitterMovedEventArgs args = new SplitterMovedEventArgs(_OldPosition, this.Top);
SplitterMoved(this, args);
}
}
private void _Splitter_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
_bDragging = true;
_OldPosition = this.Top;
this.Cursor = Cursors.SizeNS;
this.DoDragDrop(sender, DragDropEffects.Copy);
}
}
private void _Splitter_MouseMove(object sender, MouseEventArgs e)
{
if (_bDragging)
{
this.Cursor = Cursors.SizeNS;
this.Left = 0;
}
}
private void _Splitter_MouseUp(object sender, MouseEventArgs e)
{
if (_bDragging)
{
_bDragging = false;
this.Cursor = Cursors.Default;
OnSpliiterMoved();
_OldPosition = this.Top;
}
}
private void _Splitter_MouseLeave(object sender, EventArgs e)
{
this.Cursor = Cursors.Default;
}
private void _Splitter_GiveFeedback(object sender, GiveFeedbackEventArgs e)
{
e.UseDefaultCursors = false;
this.Cursor = Cursors.SizeNS;
}
private void _Splitter_MouseEnter(object sender, EventArgs e)
{
this.Cursor = Cursors.SizeNS;
}
}
Everything makes sense in someone's mind
|
|
|
|
|
Just to clarify this for me.
Are you saying the the mouseup which is part of dropping doesn't fire, or
are you saying that after completing a drag-drop, the next time a mouseup occurs the event doesn't fire?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Not sure I understand what you're asking me. In the code I pasted, the _Splitter_MouseUp event does not execute.
Everything makes sense in someone's mind
|
|
|
|
|
I am sorry that I have been slow in replying, but you replied to yourself, not to me, so I didn't know you had replied.
I'll try to explain what I want to know (remember you said mouseup did not fire after dodragdrop)
When you do the drop part of a dragdrop you have to release the mouse button. That is a mouseup , so is it this mouseup that you are asking about, or is it those that happen after that one that are the problem.
BTW you do know that there is a built in splitter control in .NET, right?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Yes, I know about the .Net spliiter.
DragDrop is new to me in C#. It sounds like you're saying that there are two MouseUp events - The standard MouseUp on many controls, and one related to DragDrop.
Or am I clueless?
Everything makes sense in someone's mind
|
|
|
|
|
KMAROIS wrote: It sounds like you're saying that there are two MouseUp events
What I was trying to establish was that there is a mouseup movement as part of the drop but that it does not fire the event, it fires the ondrop event instead.
But never mind.
Have you seen this stackoverflow[^], and more to the point, does it help in your case?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Ok, so you're asking me if I let go of the mouse button while over the control? Yes, I did.
If I comment out the DoDragDrop in the MouseDown, then the MouseUp will fire. So it's something
to do with DragDrop consuming the mouse events.
And yes, I did see the stackoverflow article, although I'm not sure I understood all of it. It looks like they coded their solution so that the drop does not occur of the mouse over the control being dragged, therefore the mouseup will fire?
Everything makes sense in someone's mind
modified on Tuesday, July 14, 2009 4:53 PM
|
|
|
|
|
From the code that you posted I can see nothing that would cause the problem behaviour. So the chances are that somehow, after the DoDragDrop, your application still thinks that the dragdrop operation is still continuing, which is why the mouseup events are not being fired. Something about the way you are handling the DragDrop event might not be completing properly.
If you have not already done so try working through the DoDragDrop example on MSDN[^], to see if you can spot any difference to the way you are doing it.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I'm certainly open to my code being wrong, but as I said in my original post, I Googled it and found other people facing the same problem.
But I will look at the MSDN example.
Everything makes sense in someone's mind
|
|
|
|