|
There is no real easy way to explain this. Either you need to know your machine ASM or if the control is .NET you need to know IL. There are several .NET Dissasmblers some even let you edit the IL code directly. Which in your case you can search for MessageBox and remove them. But there is no easyway to explain this, and most likely it will involve a lot mroe research then waht your trying to accomplish. Best bet is to have the dev's fix it or learn .NET reversing.
|
|
|
|
|
Hi all,
I am making an application, where i need to keep drawing and erasing lines over an image.
Drawing lines is ok, but i am not able to find any suitable means to remove those lines.
One method could be to draw on the same line using some other color, but that method is unsuitable since i am drawing it over an image.
Another method could be to send the Paint event so as to refresh the frame. But since i am drawing and removing the lines quite frequently, i dont think it will be a good idea to call the paint method so many times.
Can anyone please suggest a more efficient method?
Any help will be highly appreciated.
Thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
Repainting is generally a good idea. Just implement your OnPaint method the way that a flag indicates whether the lines should be drawn or not. Everytime you switch between on and off just switch the flag and call Invalidate on your control. This will lead to a repaint (and also avoid too many repaints).
If your are switching frequently you should enable double buffering to avoid flickering:
(in constructor)
base.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.UserPaint, true);
|
|
|
|
|
Hey thanks Robert!
I havent tried that yet, but will surely do when i get out of my office.
Thanks a lot.
I'll get back to you if i bump into any more problems.
Thanks again.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
How can i bind two controls together in witch that when one control scrolls the other scrolls too?
for example imagine that when a "DataGridView" scrolls , contents of a panel scroll too.
Thank you...
|
|
|
|
|
Handle the DataGridView's Scroll[^] event and add necessary code to tweak the Panel.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I have a program used to start or stop a service on window. The problem happen when the service is protected by a password. My program start service, then the password dialog appear, if I move the mouse to the dialog, the dialog changed to "not responding" state.
I have tried to use a thread, but the same thing happened!
How can I solve this problem. Thanks for your help!
Hung
Hung
|
|
|
|
|
Hi there.
I am trying to learn how to use GDI+ in ASP. I made a simple webform with a button on it. When the button is pressed a line is supposed to be drawn but nothing happens. Can someone please help me out? Here is the code:
private void Button1_Click(object sender, System.EventArgs e)
{
Pen p = new Pen(Color.Black,3);
Bitmap bit = new Bitmap(400, 400);
Graphics g = Graphics.FromImage(bit);
g.DrawLine(p, 30, 30, 97, 97);
bit.Save(Response.OutputStream, ImageFormat.Jpeg);
bit.Dispose();
g.Dispose();
}
I can´t figure out why this doesn´t work. Any help is very much appreciated.
Thanks,
FJ
|
|
|
|
|
Try adding:
Response.Clear();
Response.ContentType = "image/jpeg";
before saving the image to the output stream.
|
|
|
|
|
Please don't cross post.
Standard question #4:
No, "nothing" never happens. Exactly what is happening?
Does the button seem to work? Does the button do a postback? Is the page replaced by the image that you created?
You are writing the image to the response stream in a button event, that doesn't really work very well. As you are not even calling Response.End, the image data will be followed by the HTML code for the page.
---
b { font-weight: normal; }
-- modified at 13:23 Saturday 25th March, 2006
|
|
|
|
|
Hi ...
I corrected my original post. I hope someone can help me with what should be a simple problem.
-------------------------------------------------------
I'm having trouble setting the values of the array in my class.
I tried this ... and i can set/get "x.name" but pgm crashes with an error message that says i do not have an instance of the array item when i try to set "x.number[1]".
namespace WindowsApplication1
{
public partial class Form1 : Form
{
class myClass
{
// fields
private string _name;
private double[] _number;
// properties
public string name
{
get { return _name; }
set { _name = value; }
}
public double[] number;
public double this[int index]
{
get { return _number[index]; }
set { _number[index] = value; }
}
// Default constructor:
public myClass()
{
name = "";
double[] number = new double[5];
number[0] = 0;
number[1] = 0;
number[2] = 0;
number[3] = 0;
number[4] = 0;
}
// Clear Numbers
public void ClearNumbers()
{
double[] number = new double[5];
number[0] = 0;
number[1] = 0;
number[2] = 0;
number[3] = 0;
number[4] = 0;
}
}
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
myClass x = new myClass();
x.name = "Charlie";
x.number[1] = 123.45;
}
}
}
My program works on x.name = "Charlie";
My program fails on x.number[1] = 123.45;
Please advise on how to fix my class definition to accomodate arrays.
Thank you.
|
|
|
|
|
Hi
Your first problem is this line:
public double[] number; You are declaring a public field called number. What you want is:
public double[] number { get { return _number; } }
You have made another mistake twice - in your constructor and your ClearNumbers method. This line declares a local variable called number:
double[] number = new double[5]; What you want is:
_number = new double[5];
----------------------------
Be excellent to each other
EasiReports[^] My free reporting component for WinForms.
|
|
|
|
|
Thank you VERY VERY VERY much ... it works great!
Now i know how to do it in my real application.
Once again, thanks for your help!
|
|
|
|
|
Why are you starting a new thread? Keep it in the same thread.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I have a spreadsheet integrated in a windows form, using Microsoft Office Spreadsheet 10.0 component. I would like to know how to save or export it to a new .xls file.
Thanks.
|
|
|
|
|
Two choices: Excel Object Model or OLE DB. Depending on what type of dataset manipulation you need to do, that should drive your choice. The Excel Object Model allows closer interaction with Excel whereas OLE DB is more abstract. Search for examples of both and decide what suits your application better.g
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|
|
Hello, I`m trying to create label and then I`m trying to move it on the form, but when I drag label I see two labels instead of one. what should I do to fix it?
bool a;
Label l;
private void button1_Click(object sender, EventArgs e)
{
l = new Label();
l.Text = "text";
Controls.Add(l);
l.MouseDown += new System.Windows.Forms.MouseEventHandler(mouse_down);
l.MouseUp += new System.Windows.Forms.MouseEventHandler(mouse_up);
l.MouseMove += new System.Windows.Forms.MouseEventHandler(mouse_move);
Form1.ActiveForm.AllowDrop = true;
}
private void mouse_down(object sender, MouseEventArgs e)
{
a = true;
}
private void mouse_up(object sender, MouseEventArgs e)
{
a = false;
}
private void mouse_move(object sender, MouseEventArgs e)
{
if (a)
{
l.Location = e.Location;
}
}
arnas
|
|
|
|
|
You only see one Label but I think it is probably flickering very fast between two locations. Set the location this way:
l.Location = this.PointToClient(l.PointToScreen(new Point(e.X, e.Y)));
The location you get in the event arguments is relativ to the labels top left position so you have to calcualte the position you want to ste on the form.
|
|
|
|
|
Thanks;) now it work
|
|
|
|
|
How to make shortcut's to files in C# ???
For example I want the program to make a shortcut to the file "C:\file.dat" on the desktop???
|
|
|
|
|
I know about 2 ways for networking programming over TCP in .Net.
1) Socket, TcpListener, TcpClient
2) Remoting.
I found remoting a very easy way as compare to Sockets.
I have already developed a chat application with text chat using Sockets, now i want to add file sharing feature to it. Please tell me, using which way i should accomplish my Task. Socket or Remoting??
Are they are Equal in performace or there is some difference b/w the 2.
Note: Talkign about Remoting I'm refering to use of TcpChannel not the HTTP
Please help me in this Regards
Thanks alot!!!
Best Regards,
Rizwan Ahmed
|
|
|
|
|
Hello,
I'm developing a chat application. on a main form i maintain a list of online clients. If you want to send message to a single client(private message) then you double click the user name and a new form opened. What i want is to send an object of that message type to that form. The message type may be a string or any other user defined type.
After receiving this message on the IM window I have to display it in the chat TextBox.
My idea is to have a property in IM Form and it should be set whenever a message is received. And in the set {} of this property I invoke an even which put the text in Chat Textbox.
Is it right idea? or there is some better way to do that?
Please Guide me.
Thank in advance
Best Regards,
Rizwan Ahmed
|
|
|
|
|
I'm creating and opening new forms from a main form, set its name randomly and call Form.Show() method to show it. Now the problem is how can i detect if user has closed that form or it's still opened? or its closed and disposed.
Thanks in advance!!!
Best Regards,
Rizwan
|
|
|
|
|
How about keeping a reference and checking IsDisposed and Visible property.?.
www.troschuetz.de
|
|
|
|
|
Thanks for your interest in helping me. But I think it's not effecient way that I maintain my own global list to count the opened forms. I hope that C# will be having some built in solution for that.
Best Regards,
Rizwan Ahmed
|
|
|
|