|
Thank you all... It works!
Sweet
|
|
|
|
|
Hi,
I'am developing an image viewer in which i got an image inside a picture box.On top of the image i'am drawing a rectangle.But once delete the rectangle drawn on the image the mouse pointer is getting arrested to the boundaries of the image.This problem comes when i delete the image using the context menu...The code i use 4 it is given below...
foreach (Shape s in SelectedShapes)
{
Shapes.Remove(s);
}
SelectedShapes.Clear();//Clear the arraylist
Invalidate();
This is not happening when i'am deleting the shape using the keyboard.But what is confusing me is that i have clled the same code as given above inside that also..The only diff is 'am checking whether the key press is DELETE or not.
This problem also gets solved when i click once on the image after deleting the shape ..
Kindly help me
MMX
|
|
|
|
|
Make sure you're not setting the Cursor.Clip static property, as this clips (confines) the cursor's region in which to move around.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Arrested?!
For what?
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I was thinking of writing a tunneling program much like that of Ytunnel for yahoo. Nothing public other than I might post the code on here upon completion. In any event, I am not that experienced with protocols and proxys in the form of programming. Other than reading through the sdk is there any specific pages one could point me to to get a head start on making a proxy server or tunneling? I'm open for collaboration as well. I have only been coding in c# for around 4 months or better now so I figured this would be a great project. Just looking for some help on how to go about doing it.
Thanks for your reply
Win32newb
"Programming is like sex, make one mistake and you have to support it for a long time"
|
|
|
|
|
i don't have much idea about your requirement . anyhow see the link
http://www.codeproject.com/internet/httptunneling.asp
you can use our search option to find article.
give keyword like
tunneling or proxy server.
Sreejith S S Nair
|
|
|
|
|
C# really isn't suited for this. Packet mangling is a low-level operation and requires optimal performance. A managed environment really isn't suited for this.
There are many tunneling programs - including secure ones like ssh - which already do the job and do it well. ssh, for example, is written by experienced cryptographers and developers and is supported by the community and several companies.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for the informative reply Heath. I like many others always look forward to your reply.
Thanks again
|
|
|
|
|
I'm trying to disply a picturebox on top of an existing picturebox and the second one is showing up underneath the first and isn't visible. Is their a simple solution to remedy this , I really hope so because I don't want to rewrite a bunch of code. The picturebox that is underneath has a bitmap of a poker table and the picturebox on top is a bitmap of the cards that are going to lay on the table. If anyone can help I would really appreciate it. Thanks.
|
|
|
|
|
See if these two methods help you:
BringToFront()
SendToBack()
Why do we close our eyes, when we dream?, When we cry?, When we imagine?, When we kiss?, Its because the most beautiful things in the world are unseen
|
|
|
|
|
I tried these but it doesn't work. I tried to SendToBack the image that was supposed to be on the bottom and SendToFront on the image that was supposed to be on top but the SendToFront image was still underneath. Thanks any way though.
|
|
|
|
|
Well you have to make a class and inherit pictureBox.
then inside the class
protected override CreateParams CreateParams
{
get
{
CreateParams cp=base.CreateParams;
cp.ExStyle|=0x00000020;
return cp;
}
Protected override void OnPaintBackground(PaintEventArgs e)
{
}
Win32newb
"Programming is like sex, make one mistake and you have to support it for a long time"
|
|
|
|
|
This is a pretty bad way of trying to comp an image. While not either extend PictureBox or even just some other control and override OnPaint . Paint the pictures in the order you want them to appear. So, you'd paint the bottom image first, then paint the top image second. Overriding OnPaint will pass you a PaintEventArgs , from which you can use the Graphics property to call DrawImage or DrawImageUnscaled . It's really quite easy.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
When the mouse is moved over PrintPreviewControl, how to change the cursor when it is on the document that is displayed in the control. It should remain at default state outside the document.
regards
|
|
|
|
|
change the cursor property of printPreviewcontrol.
Sreejith S S Nair
|
|
|
|
|
if i change it, the cursor will change as soon as mouse enters in the PrintPreviewControl, thats not solving my problem, i want it to change only on the document that is displayed inside the control. meaning, there exist some vacant area inside the control that is not been occupied by the displayed document, in that area cursor should have default value. It should change on the area occupied by the document.
regards
|
|
|
|
|
THe PrintPreview Control doesn't expose this kind of functionality. You'd have to extend the control and add this functionality yourself. Calculating the screen coordinates of the page 'image' is going to be the hard part. Since the underlying control does all the painting, your going to have a ruff time doing this. You could at least use the OnEnter and OnLeave events of the control to know when the mouse is actually in the control. From there, you'd have to figure out the coordinates relative to the page image rectangle(s).
No, I haven't done it before, and don't know exactly how. I have no source code or sample to give you...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
More over can we decide the layout of the document to be displayed, meaning can we decide like A4 or Letter size layout for the document?
|
|
|
|
|
Yes. See the PageSettings property, which sets the default page size, though you can change it if desired while printing each page. It's all documented in the .NET Framework SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I think I did't get your answer, there is no such property in the property list of PrintPreviewControl.
Please elaborate more, also guide me about the first question
regards
|
|
|
|
|
The PageSettings doesn't belong to PrintPreview... It belongs to the PrintDocument that the PrintPreview control is using as a source.
A simple search in the documentation would have told you this. All you had to do is type 'PageSettings' into the Index...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How to sence click even on the document when two pages are displayed in PrintPreviewControl.
How to identify which page is clicked?
|
|
|
|
|
The PrintPreviewControl doesn't expose this functionality. You'd have to extend the PrintPreviewControl class and write the functionality in yourself. Getting the screen coordinates of the page 'images' will be the ruff part (Good Luck!). Once you have that, it's not too hard to figure out if the mouse cursor is inside those rectangles to determine which page is clicked.
A better bet would be to look into a 3rd party PrintPreviewControl.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi All
I have a problem where i am reading in a csv file but within the file each field within a line has double quotes surrounding the data, and occassionally the data will have commas in it eg: "01","test","this,is the,problem","test"
What i want to do is remove the commas within the quotes, and leave everything else.
If any one has an idear please help.
regards Odyssey
|
|
|
|
|
Actually, the real problem is how you're parsing the file. Instead of simply using String.Split to split using commas, enumerate the characters in the line and keep track of when you come across a double quote. Increment a counter or set a boolean. When you run into another quote, decrement your counter or reset a boolean. When the counter is 0 or your boolean is false, then you can parse a comma-dilimited field. The typical CSV (there really isn't a standard) uses double quotes to signify that a delimited field may contain the actual delimiters. Simply removing the delimiters within those quotes would be corrupting the data.
Microsoft MVP, Visual C#
My Articles
|
|
|
|