|
Hi,
How do do I animate the movement of a simple shape (a ball) across the
client area? --thanks
|
|
|
|
|
Easiest way - an animated gif. Drawing it yourself, set a timer, and draw the frames in WM_PAINT.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am facing problem with my custom control. Please help urgently.
My control inherits a Windows.Forms.Panel control. I have set the AutoScroll property of the base control (panel) to true. I added a PictureBox in the at location (Left = 0, Top = 0) in the panel control. Size of the PictureBox is large enough to show the ScrollBars for the base control (panel).
In the Paint Event handler of the picture Box I am drawing a rectangle.
To scroll (make it visible completely in the Client area) to the drawn rectangle, I added a transparent Label control and set its bounds(location, size) as of drawn rectangle in runtime after drawing the rectangle and called the Panel's ScrollControlIntoView method.
Scrolling works, but when I change the location and size of the rectangle to draw it to another location, the rectangle intersects the client rectangle of my control (i.e. not visible completely in the client rectangle).
How can I avoid it?
How do I know if my rectangle is intersecting the client rectangle?
Or
How do I position my transparent label such that it is completely visible in the client rectangle?
Or
Suggest me any other way
Thank You,
Gulfraz Khan
|
|
|
|
|
how can i implement the zoom over a picturebox?
And over custom controls?
|
|
|
|
|
|
Hi I have a web application where a user downloads a file(eg word doc) from a db, makes changes on the file. My question is, how do I get the edited file reuploaded into the db. Filename left intact.
|
|
|
|
|
You need to provide a file browser control ( they need to browse to the file and select it, then click on a button to upload ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Christian. Thanks for your response. I'm talking about files that have previously been uploaded.
To clarify myself, the file is retrieved from the db, and written using the ffg line of code:
Response.Clear();
Response.ContentType = FILE_TYPE;
Response.OutputStream.Write(FILE_IMAGE,0,FILE_IMAGE.Length);
Response.AddHeader("Content-Disposition", "attachment;filename=" + FILE_NAME);
Response.End();
My question is, once the user makes changes to the displayed file, how do you reload the edited file into the db?
|
|
|
|
|
Even though the file comes from you, unless the user requests the file to be uploaded, I know of no way for IE to send the file back up again, even though it is running Word in the browser.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have a listview with resizable columns that may potentially be wide enough to require a horizontal scrollbar. When I periodically refresh the contents of the lv it's position is always reset with the scrollbar shifted to show the leftmost part of the list. I want to keep the scrollbar position where it is, so that if the user is looking at items at the extreme right of the list they won't have to move the scrollbar after the update. Looking through the properties of the listview class I didn't see anyway to access this value.
|
|
|
|
|
Can anyone tell me either
a) how to find the user of a process
or, failing that
b) how to find the currently logged in user
with .NET1.1 under Windows 98 without WMI.
Dave
|
|
|
|
|
|
Argh - yes. However, that returns the user that is running the current process, not a specific process from the processes list. I suppose, thinking about it, it's probably the same thing under Windows 98, as there are no services so presumably no "system" users, and no fast user switching, so all processes must be run by the same user.
Also, I had very odd results with Environment.UserName - if I didn't set up any users on a new W98 installation then Environment.UserName returned "User" which must be some sort of default. However, I then set up a real user. Then, when I logged in, I hit Cancel on the login dialogue. Now, strangely, Environment.UserName returns blank. Go figure, as they say. I suppose W98 just doesn't handle users properly and there it is.
Nevertheless, thanks for getting back to me.
Dave
|
|
|
|
|
How to find file in hard disk?
|
|
|
|
|
Directory.GetFiles(directoryToSearch, fileName) where fileName can include wildcards
Ed
|
|
|
|
|
I have a simple application that takes a folder path and open in the windows explorer.
Here is the code i use
Process p = new Process();
p.StartInfo.FileName = "explorer.exe";
p.StartInfo.Arguments = strFilePath;
p.Start();
The problem is that when the filepath contains spaces it works just fine on my xp machine but on my clients machine which use windows 2000 the application fthrows the exception filenotfound.
I would like to know why it works on xp and doesn't on windows 2000
|
|
|
|
|
try by this
...
p.StartInfo.FileName = "iexplorer.exe";
...
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
Have you tried wrapping the path with embedded quotes.
"\"path with spaces\myapp.exe\""
-- modified at 11:04 Thursday 16th March, 2006
More generally, paste the exact string you send to the process class into the run dialog and see what happens there.
|
|
|
|
|
hi,
i am using DrawString method to display text in my Smartphone application when form is painted. i have added a method to the Paint event handler for this:
this.Paint += new PaintEventHandler(DrawMainPage);
when i get new data i have to repaint the form to inorder to show new data.
but when i call myform.invalidate() from different form then i gives me error that i have to invoke this method from the same thread.
i tried do upate my code accordingly (http://www.codeproject.com/csharp/begininvoke.asp)
but i get the same error.
will appreciate help.
regards,
rnv
|
|
|
|
|
Try making sure that you're Main function is marked with a STAThread attribute. If you're not using any multithreading that it
Ed
|
|
|
|
|
i would like to know how to read an image with c#
if u can give me a code in witch there are an example
developpement
|
|
|
|
|
Do you mean this?
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
You can use this code:
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)<br />
{<br />
Graphisc g = e.Graphisc;<br />
Bitmap bmp = new Bitmap("your_image.jpg");<br />
g.DrawImage(bmp, 0, 0);<br />
}
-- modified at 9:27 Thursday 16th March, 2006
|
|
|
|
|
Except that it will leak resources. The Bitmap reading code should ideally read to a member variable ( why do it every time ? ), or at a minimum, should be in a 'using' block.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have a Deployment project which includes a Customer Information Dialog box. I want to use the information entered in my Custom Action class AfterInstall. Does anyone know how I can do this?
|
|
|
|