|
Thanks for alll your replies.
|
|
|
|
|
I have to include a image such that it is editable when clicked on it.
Can any one help me?
|
|
|
|
|
|
http://msdn.microsoft.com/en-us/magazine/cc164043.aspx[^]
1) Open up your form in design view
2) In the toolbox, Right click and select "Choose Items"
3) When the dialog pops up, click the "Com components" tab
4) scroll down to "Microsoft Visio x.x Drawing Control" and tick it.
5) Hit OK
6) The control will appear in the toolbox under General.
7) Drag the control onto your form.
You can use this control to display a Visio drawing and allow the user to edit it. See the MSDN article above for a tutorial of using the control.
Note that this will bind to a specific version of Visio. The user must have that version installed to use your app. There is a way of bundling up a lite installer with your app, that the article talks about. I would assume the user still has to have a Visio license, but I'm not sure.
Simon
|
|
|
|
|
hi,i have a form and when you click a button you show a webbrowser whith a flash and a textbox in the html,and i would obtain the information of the textbox(is in the web page) how i can?
|
|
|
|
|
You need to do this by inspecting the website using the DOM. It's not a simple thing, the web browser is it's own world, it doesn't expose stuff like a windows app
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I'm using an Access file as data source of a crystal report Report, in my computer all is ok, but when install my application in another system, because the path of mdb file changes, the report don't work?
how can give a related path in crystal report or force it to read the path from a setting file?
Best wishes
|
|
|
|
|
mehrdadc48 wrote: I'm using an Access file as data source of a crystal report Report, in my computer all is ok, but when install my application in another system, because the path of mdb file changes, the report don't work?
how can give a related path in crystal report or force it to read the path from a setting file?
You will need to define the connection parameters to the report within your code.
HTH.
|
|
|
|
|
hi
i need a control that display my image maps and panning and zooming it in my control.
i was create a userControl named ImageMap, and add a panel to it and set Doc to Fill and wrote this code to get result :
public partial class ImageMap : UserControl<br />
{ <br />
Bitmap bitmap; <br />
BufferedGraphicsContext currentContext;<br />
BufferedGraphics myBuffer; <br />
PointF viewPortCenter;<br />
float Zoom = 1.0f;<br />
<br />
bool draging = false;<br />
Point lastMouse;<br />
public static Rectangle rec;<br />
<br />
<br />
public ImageMap()<br />
{<br />
InitializeComponent();<br />
currentContext = BufferedGraphicsManager.Current;<br />
setup(false);<br />
rec = this.panel1.DisplayRectangle;<br />
} <br />
<br />
private void setup(bool resetViewport)<br />
{ <br />
if (myBuffer != null)<br />
myBuffer.Dispose();<br />
myBuffer = currentContext.Allocate(this.panel1.CreateGraphics(), this.panel1.DisplayRectangle);<br />
if (bitmap != null)<br />
{<br />
if (resetViewport)<br />
SetViewPort(new RectangleF(0, 0, bitmap.Width, bitmap.Height)); <br />
} <br />
this.panel1.Focus();<br />
this.panel1.Invalidate();<br />
} <br />
<br />
private void SetViewPort(RectangleF worldCords)<br />
{ <br />
if (worldCords.Height > worldCords.Width)<br />
{<br />
this.Zoom = worldCords.Width / bitmap.Width;<br />
}<br />
else<br />
this.Zoom = worldCords.Height / bitmap.Height;<br />
<br />
viewPortCenter = new PointF(worldCords.X +(worldCords.Width / 2.0f), worldCords.Y + (worldCords.Height / 2.0f));<br />
<br />
} <br />
<br />
private void PaintImage()<br />
{<br />
if (bitmap != null)<br />
{<br />
float widthZoomed = panel1.Width / Zoom;<br />
float heigthZoomed = panel1.Height / Zoom;<br />
<br />
if (widthZoomed > 30000.0f)<br />
{<br />
Zoom = panel1.Width / 30000.0f;<br />
widthZoomed = 30000.0f;<br />
}<br />
if (heigthZoomed > 30000.0f)<br />
{<br />
Zoom = panel1.Height / 30000.0f;<br />
heigthZoomed = 30000.0f;<br />
}<br />
<br />
if (widthZoomed < 2.0f)<br />
{<br />
Zoom = panel1.Width / 2.0f;<br />
widthZoomed = 2.0f;<br />
}<br />
if (heigthZoomed < 2.0f)<br />
{<br />
Zoom = panel1.Height / 2.0f;<br />
heigthZoomed = 2.0f;<br />
}<br />
<br />
float wz2 = widthZoomed / 2.0f;<br />
float hz2 = heigthZoomed / 2.0f;<br />
Rectangle drawRect = new Rectangle(<br />
(int)(viewPortCenter.X - wz2),<br />
(int)(viewPortCenter.Y - hz2),<br />
(int)(widthZoomed),<br />
(int)(heigthZoomed));<br />
<br />
<br />
myBuffer.Graphics.Clear(Color.White);
<br />
myBuffer.Graphics.DrawImage(bitmap, this.panel1.DisplayRectangle, drawRect, GraphicsUnit.Pixel);<br />
myBuffer.Render(this.panel1.CreateGraphics());<br />
} <br />
}<br />
<br />
protected override void OnBackgroundImageChanged(EventArgs e)<br />
{<br />
bitmap = (Bitmap)this.BackgroundImage;<br />
setup(true);<br />
base.OnBackgroundImageChanged(e);<br />
}<br />
<br />
protected override void OnResize(EventArgs e)<br />
{<br />
setup(false);<br />
base.OnResize(e);<br />
}<br />
<br />
private void panel1_Paint(object sender, PaintEventArgs e)<br />
{ <br />
PaintImage();<br />
}<br />
<br />
private void panel1_MouseWheel(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
Zoom += Zoom * (e.Delta / 1200.0f);
if (e.Delta > 0)
viewPortCenter = new PointF(viewPortCenter.X + ((e.X - (panel1.Width / 2)) /(2* Zoom)), viewPortCenter.Y + ((e.Y - (panel1.Height/2)) / (2*Zoom))); <br />
this.panel1.Invalidate(); <br />
}<br />
<br />
private void panel1_MouseDown(object sender, MouseEventArgs e)<br />
{<br />
if (e.Button == MouseButtons.Left)<br />
draging = true;<br />
}<br />
<br />
private void panel1_MouseMove(object sender, MouseEventArgs e)<br />
{<br />
if (draging)<br />
{<br />
viewPortCenter = new PointF(viewPortCenter.X + ((lastMouse.X - e.X)/Zoom), viewPortCenter.Y + ((lastMouse.Y- e.Y)/Zoom)); <br />
panel1.Invalidate(); <br />
}<br />
lastMouse = e.Location;<br />
}<br />
<br />
private void panel1_MouseUp(object sender, MouseEventArgs e)<br />
{<br />
if (e.Button == MouseButtons.Left)<br />
draging = false;<br />
} <br />
}
but in runTime, when i panning image in my control, it has a flicker and very bad result, for solve this problem, in top of above code, i define a new class that derived from Panel and wrote this code :
public class overRidePanel : Panel<br />
{<br />
protected override void OnPaintBackground(PaintEventArgs pevent) <br />
{<br />
<br />
}<br />
}
then modify my panel to instanciate from new overRidePanel class, as u can see in above code, i was override OnPaintBackground event only, then run my app, it gave me best result and remove flicker when i panning and zomming my images in app, but when my app run, the ImageMap does not have a any image to display it, and my control in runTime does not display white color correctly(it show back of the my app and not good for me), i want when i start app, it is white color before selecting image, but how to do ?
thanks
|
|
|
|
|
Hello,
I've been trying for while now to upload a picture and get it to be displayed in an Image control. I still can't get the code right. I used
FileUpload1.PostedFile.SaveAs(filepath);
Image1.ImageURL = filepath;
after performing the necessary checks. The ASP.NET debugger says the path format is not supported. I need help.
Thanks.
Obinna from Nigeria.
PS. I'm using VS 2005.
//obinnaaj Eof
|
|
|
|
|
You need to store it within your web app, then your imageURL needs to be a URL to the file, not a path on the file system. Server.MapPath is how you convert them,
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
In .Net, Text box control is in square shape. I would like to change the shape of the control to Circle from square shape. Is it possible to customize the shape of Textbox control as circle?
Thanks in advance.
|
|
|
|
|
By overriding OnPaint method
|
|
|
|
|
Not really, no. The textbox in windows sucks because it paints itself often outside it's paint event. It can be done, but it's hard work. Why not just draw a circle of white around the edges of a textbox with no border ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
*grin* for any other control it would probably be right. It still is, excepting that you need to handle a bunch of other events and force repaints, and you'll never get rid of the flicker.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks
Meanwhile, was the reply for the earlier thread (disable copy paste) correct?
|
|
|
|
|
Yes, it looked like it to me. I'd have to try it to see if it worked, but that's what I had in mind.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for your reply. But how to draw circle in windows form design? Please guide me.
|
|
|
|
|
The FillEllipse method of the Graphics class. You'd create a control with a textbox and a circle drawn around it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello,
how to disbale copy paste from and to textbox programatically
|
|
|
|
|
hey
you might be able to "catch" the event of(ctrl + c) and (ctrl + v) and not handle it...
that might do the trick
Hav fun
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
You may be able to do this by catching the keystrokes and rejecting them. I don't think there's a paste event. You would probably need to reset the clipboard after a CTRL-Insert or CTRL-C, b/c it's probably already done.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Like this:
private void textBox1_KeyDown(object sender, KeyEventArgs e) {<br />
if(e.Control && e.KeyCode == Keys.C) {<br />
e.SuppressKeyPress = true;<br />
}<br />
else if(e.Control && e.KeyCode == Keys.V) {<br />
e.SuppressKeyPress = true;<br />
}<br />
}
|
|
|
|
|
private void textBox1_KeyDown(object sender, KeyEventArgs e) {
if(e.Control && e.KeyCode == Keys.C) {
e.SuppressKeyPress = true;
}
else if(e.Control && e.KeyCode == Keys.V) {
e.SuppressKeyPress = true;
}
}
this is good, but i do't want to this code paste in all control.
i want this code type only one time
|
|
|
|