|
Telling what exception you are getting is generally more helpful than
Parshant Verma wrote: dispaly exception at MouseEnter
only two letters away from being an asset
|
|
|
|
|
it display exceptio:
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in system.drawing.dll
Additional information: png1\001.png
and also open a Disassmebly and point to
00000056 mov ecx,esi
|
|
|
|
|
|
Exception says file not found i am getting
but the same code working with another button Folder browse.
|
|
|
|
|
Parshant Verma wrote: But when i click on Browse for file button if appear over the form and also covered the button and dispaly exception at MouseEnter event .
I don't understand what you mean by that sentence. What is appearing over the form?
---
b { font-weight: normal; }
|
|
|
|
|
my mean it this whenever i click on file button OpenFileDialog open and covered the file button
Might be it relate to exception that why i told this point
|
|
|
|
|
I see.
What is the exception that you get, and what does the code look like?
---
b { font-weight: normal; }
|
|
|
|
|
exception i am getting file not found
but before click on the file button everything going perfect and the same evevt is fine working
private void btn_select_file_MouseEnter(object sender, System.EventArgs e)
{
try
{
file.Image=System.Drawing.Image.FromFile(@"png1\002.png");
}
catch (System.Exception e1)
{
MessageBox.Show(e1.Message.ToString());
}
}
private void btn_select_file_MouseLeave(object sender, System.EventArgs e)
{
try
{
btn_select_file.BackgroundImage=System.Drawing.Image.FromFile(@"png1\001.png");
}
catch (System.Exception e2)
{
MessageBox.Show(e2.Message.ToString());
}
}
private void btn_select_file_Click(object sender, System.EventArgs e)
{
if(openFileDialog.ShowDialog()==DialogResult.OK)
{
btn_select_file.DialogResult=DialogResult.OK;
btn_select_file.BackgroundImage=System.Drawing.Image.FromFile(@"png1\002.png");
txt_select_file.Text=openFileDialog.FileName.ToString();
SelectButton=1;
btn_select_folder.Enabled=false;
}
}
|
|
|
|
|
This last information that you provided suddenly makes the error very obvious. It has nothing at all to do with event handling.
You are opening files using a relative path, that means that you are using the current working directory as a starting point. The file selector dialog also uses the current working directory, and changes it as you navigate through the folders. That means that your code is trying to open the image files from a different starting point, where the images doesn't exist.
The quick solution would be to store the value of the current directory when starting the application, so that you could use that value for locating the images. But I don't understand why you create a new Image object from a file every time the mouse pointer enters or leaves the control. You'd be better off by loading the images at startup, so that you can use the same Image objects over and over.
---
b { font-weight: normal; }
|
|
|
|
|
Hi!
I want to disable or hide the dropdown list in comobox. Can I do this and HOW?
Set DropDownStyle to Simple is not ok for me, because I want to allow AutoComplete mode. When I select value from suggest list of autocomplete mode selecting value doesn't work. Combobox has binding to dataset.
If DropDownStype is not set to Simple selecting value works fine, but I must hide dropdown list from user.
Thanks
|
|
|
|
|
I am working on a C# project. I have already completed the project but now I am looking for something like:
1.. Customer start the software and he will be asked to register on my site which uses a optin newsletter script. It will then store the member information into the mysql db.
2.. My software will then check if the member is registered.. if so it will then store his computer hardware id next to his email address in the database.
3.. Everytime the software will check the user details. this way he cannot share his copy of the software with the other.
4.. Also another point is if this customer is unsubscribed from my list he wont be able to use my software.
|
|
|
|
|
Did you have a question
only two letters away from being an asset
|
|
|
|
|
I have already posted it and I guess it was a question itself.. anyway here it is again.
I am looking for something like below but I dont know how to do: Can you please tell me how do I do it in C# ?????????????
I have a software and I want to do....
1.. If Customer start the software and he will be asked to register on my site which uses a optin newsletter script. It will then store the member information into the mysql db.
2.. My software will then check if the member is registered.. if so it will then store his computer hardware id next to his email address in the database.
3.. Everytime the software will check the user details. this way he cannot share his copy of the software with the other.
4.. Also another point is if this customer is unsubscribed from my list he wont be able to use my software.
I only know that this can be done with a PHP interaction but dont know how to interact with PHP i.e. sending information to php from software and getting output from php to this software.
|
|
|
|
|
WebRequest and WebResponse
only two letters away from being an asset
|
|
|
|
|
I tried typing WebRequest but I dont know how to get system.net class.. do you have any dll or know where I can download it... Also any code sample for WebRequest and WebResponse in c# would be great...
Thanx..
|
|
|
|
|
|
Hi all,
I have created an application in C#.
The application will be distributed to many users.
Some new features will be added later to the app.
Now i want to create a functionality that will be like
Whenever the app starts, it will first check on the server for
files with new version and should replace the existing with new version files. I want the app to automatically download the new dll's and replace the existing ones with these new ones.
Any reference or link or sample code in this regard will be appreciated.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
you can use setup factory setup 7.0 {Search it fro google} for your product! their you will find the auto update functionality inside which conncet your product to server....
|
|
|
|
|
That seems to be some product.
I don't have to use external products.
Is there any feature in .Net for this.
Or some customized code?
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
If the app is 2.0 based you can use Click-Once. Otherwise look at the Updater Application Block from Microsoft's Patterns & Practices group.
only two letters away from being an asset
|
|
|
|
|
I don't know how to minimize my program in system tray.
Please answer me.
Vasildb
|
|
|
|
|
using System.Windows.Forms;
//button event
private void btnTray_Click(object sender, System.EventArgs e)
{
// Hide the main form, as a program running as a tray icon doesn't typically
// have a visible form.
this.Hide();
ntfSystemInfo.Visible = true;
ntfSystemInfo.Text = "System Information";
}
//the code is not enfough please see help in msdn
|
|
|
|
|
Thanks. But if the code is not enough.
I have Visual Studio 2003.
Vasildb
|
|
|
|
|
Adding tray icons and context menus[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Hi,
Using csharp and the .net farmework i could run a thread like this and update the UI such as a label.
example :
Thread mythread = new Thread(new Threadstart(myfunction));
mythread.Start();
void myfunction()
{
lblstatus.text = DoWork();
}
Now using this same code which works in vS 1.1 dont wanna update the UI label in net 2.0 Why ??
Im using c# expression edition .
Thanks in advance
|
|
|
|