|
In the page load event
If (!IsPostBack)
{
Button1.Attributes.Add("onClick","displayMessage");
}
Ben
|
|
|
|
|
No No. I have done ur clientclick Event. Which is working fine. But i need the same type of event for the Page onload Event also. Would you help me.
Regards,
A Jabeer Ali
|
|
|
|
|
If you want some javascript to run when the page loads you will have to set the onload event in the body tag in your html.
Hope that helps.
Ben
|
|
|
|
|
S mate. ur Rite But that javascript is not even Called by the onload event.
Regards,
A Jabeer Ali
|
|
|
|
|
I've tried to find this online. No luck... so I've tried this. I would like to create a user control that has the triangle with smooth corners. (not the drawing... the user control to be that shape.) I've succeeded create a triangle user control using polygon but when adding addArch method, it erases the arch inside the triangle, not the outside to produce smooth corner. The example of graphic is shown at: <a href="http://www.geocities.com/livfalls/exampletriangle.jpg">http://www.geocities.com/livfalls/exampletriangle.jpg</a>[<a href="http://www.geocities.com/livfalls/exampletriangle.jpg" target="_blank" title="New Window">^</a>]
Can anyone help? Thanks in advance. My sample code is shown below:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
GraphicsPath path;
public Form1()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs pevent)
{
Graphics g = pevent.Graphics;
g.SmoothingMode = SmoothingMode.AntiAlias;
// Create painting objects
Brush b = new SolidBrush(this.ForeColor);
Pen pen = new Pen(b, 10);
// Create Rectangle To Limit brush area.
Rectangle rect = new Rectangle(0, 0, 150, 150);
path = new GraphicsPath();
innerPath = new GraphicsPath();
path.AddLine(150, 91, 230, 230);
path.AddArc(200, 200, 30, 30, -60, 120);
path.AddLine(230, 230, 70, 230);
path.AddLine(70, 230, 150, 91);
this.Region = new Region(path);
// Dispose of painting objects
b.Dispose();
linearBrush.Dispose();
}
}
}
|
|
|
|
|
I only see one arc, you would need three to draw that shape.
Are you drawing the arc in the right direction?
---
single minded; short sighted; long gone;
|
|
|
|
|
Yes.. I would need 3 arc (one for each corner). I need to figure out how to do the arc so I can eliminate the sharp corner of the triangle. I think I need to use the AddBezier method. I'm working on that now with the calculations.
|
|
|
|
|
when you add arcs you don't have to add lines.. the are added automatically..
Blubbo wrote: I think I need to use the AddBezier
you can but as you started with arcs you can try getting a proper angle so the transion between arc and line wouldn't be visible..
life is study!!!
|
|
|
|
|
Ahh now that makes more sense! I'll try that!
|
|
|
|
|
I used AddBezier method for each of 3 curves (per my calculations) and it worked great!
Thanks a heap!
-- modified at 13:43 Wednesday 16th May, 2007
|
|
|
|
|
hi i have devoloped windows application,
i wanna update that perticular developed version with my current(yet to develop)windows application
can u please let me know how to fine and compare the versions,
i got my current(yet to develop-update version's) assembly by using Assembly.GetExecutingAssembly().ToString()
but, i want knw the current deployed version's assembly name
so that i can find and update if its lower version else give a prompt saying this is already updated version..
hope u got my requirement
thnx in advance
prashanth
|
|
|
|
|
Assembly myAssembly = Assembly.GetExecutingAssembly();
FileVersionInfo info = FileVersionInfo.GetVersionInfo(myAssembly.Location);
// info.ProductVersion gives you the complete version.
// fileVersionInfo also contains many other property for details.
Hope this helps.
Regards
|
|
|
|
|
Nice to find an expert on an important function. y any chance, do you know if the following snippet is how to get the hinstance we should pass to Bitmap.FromResource()?
<code> String s = "MT_ConfirmREFRESH";
IntPtr h = Process.GetCurrentProcess( ).Handle;
try
{
Glyph1.GMap = Bitmap.FromResource( h, s );
}
catch
{
throw new Exception( "Bitmap resource " + s + " not found from process handle " + h.ToString( ) + "." );
}
</code> Documentation indicates that hinstance is supposed to be "A handle to an instance of the executable file that contains the resource." The snippet is part of a method of a class belonging to a .DLL to which the resource(s) have been added by the visual Project.Properties... Add existing file... process. When this code fails, the FCL message only indicates that "the" (a) parameter is not valid. The resources ostensibly exist. I assume the handle value is the most probable candidate for the problem, unless there is some problem with the registration of the resources which I am not aware of.
Much thanks,
m
|
|
|
|
|
In other words, the following approach does identify the assembly I need to identify, but I run into a dead end trying to get an IntPtr handle from the "ModuleHandle" struct:
Type t = this.GetType( );
Assembly a = Assembly.GetAssembly( t );
ModuleHandle mh = a.GetModule( "APC" ).ModuleHandle;
Do you know of a way to get the IntPtr value that will return the resources we need to find with Bitmap.FromResource()?
|
|
|
|
|
Hello,
I'm not an expert at all, but I found this article, where it is done by an "Kernel32.dll" method call.
http://www.codeproject.com/cs/miscctrl/XPTaskBar.asp[^]
[DllImport("Kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr LoadLibrary(string lpFileName);
Hope it helps!
All the best,
Martin
|
|
|
|
|
Thanks, Martin, but the problem here is the approach is not CLS compliant. We need to be able to do this with managed code. It's "as if" Microsoft left out a vital bridge so that, as we are obstructed from a managed solution, we are forced to write Microsoft-dependent approaches.
|
|
|
|
|
Ok, I see!
P.S.: Have no idea why somebody voted "2" for your statement?
Gave you "5" to bring it back in shape!
All the best,
Martin
|
|
|
|
|
hi all
i have a problem to show a picture or gif image b/w request and response (b/w server and the client).
what i tried was image visible false basically...
when button click when it request server i made the image visible true...
but the image is visible only after the response from the server ...
what should i do...???
bye
|
|
|
|
|
Hi All,
Am just learning things. Can you explain me whether an Interface is a super set to Abstract Classes?
In what way Abstract Classes can prove more useful than an interfaces? I know that it is not instantiable. Can you give me a small scenario were Abstract Class will be the only solution rather than using Interfaces?
Regards,
Panicker.
|
|
|
|
|
|
Thnx Stefan.
Regards,
Panicker.
|
|
|
|
|
An interface defines a contract. It contains only signatures of methods, properties, etc.
An abstract class can contain implementations, but cannot be instantiated.
A good way to determine if you need an abstract class vs. interface would be:
If you plan on having derived objects, all of which will need to do some of the same thing, you should use an abstract class.
Keep in mind, that abstract classes and interfaces can be used in conjunction where appropriate.
|
|
|
|
|
Can we say that Interface is pure virtual form of an abstract class? (similar to OOPS concept)
-rt
|
|
|
|
|
ArtiGujare wrote: Can we say that Interface is pure virtual form of an abstract class? (similar to OOPS concept)
Yes, you could, but I don't know if that would make it less or more confusing...
An interface contains no implementation, in much the same way that a pure virtual method doesn't contain any implementation.
However, an important difference is that you inherit a class, but you implement an interface. As .NET doesn't have multiple inheritance, a class can only inherit from one base class, but you can make a class implement as many interfaces as you like.
---
single minded; short sighted; long gone;
|
|
|
|
|
Another example you often see is an abstract class partially implementing an interface. A good example of this is System.Collections.DictionaryBase providing partial implementation of common functionality to System.Collections.IDictionary interface.
-----
Formerly MP(2)
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
|
|
|
|