|
i am using a treeView control in which i want to display image against its every node. the images are placed in project directiory's \bin\release folder. now the tree is popupulated when the form is loaded i.e the statements of populating the tree are after calling
InitializeComponent();
in the constructor of new form. at first time when i come 2 this form (calling it against the NEXT button of a prevous form) then no problems occur and the images are loaded without any complication but when i go back to a previous form and come back to this form through same path and using same NEXT button then fileNotFound exeception occurs at this line
Image img = Image.FromFile("pic1.jpg");
but previously images were displayed successfully...!
i am facing same problem when i rightclick and create a contextMenu against a node. images are displayed against each optin of contextMenu successfully at first but when i click some option of contextMenu then work n then rightclick same node then the same exeception fileNotFound occurs(while populating ContextMenu) at same sort of lines...
further more if i am debugging the project then these fileNotFoundException occurs even for the first time when i populate the tree.but when i run the project no error comes for the first time and the images are loaded successfully....but only for first time..!
i canot understand where the problem lies??
May God help u solv ur problems as well,thx in advance!!
|
|
|
|
|
Hi
I can't exactly tell you what is the problem but it seems that there's a problem in finidng the directory of images.If that's the problem ,you can use Application.ExecutablePath property to get the path then combine it with the file name (for example Path.Combine(Application.ExecutablePath,"image1.pic")
Regards
|
|
|
|
|
By default we assign absolute path to the initialdirectory of the openfile/savefile dialog control how can we assign a relative path that checks in the current directory.
thanks.
|
|
|
|
|
kalaveer wrote: that checks in the current directory.
Directory.GetCurrentDirectory(); could help.
V.
Stop smoking so you can: enjoy longer the money you save.
|
|
|
|
|
neither dialog control nor form has the method of Directory.GetCurrentDirectory(); can you please tell me with which and how can i use this.
thanks.
|
|
|
|
|
System.IO.Directory.GetCurrentDirectory();
|
|
|
|
|
Hi, Dear Respected Programmers
Kindly help me and convert following VB6 command into C# language.
Thank you
Text1.Text = IIf(Check1.Value = 1, "GOOD", "BAD")
|
|
|
|
|
Text1.Text = ( Check1.Value == 1 ) ? "GOOD" : "BAD";
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
|
What's the diffenrence between these two assemblies?
I encountered with an error when i tried to move a VS 2005 Shared Add-in project from one computer to another. The original machine has got VS 2005 Team Suite on it while the second one has got VS 2005 Professional Edition. During the original development on the first computer, I referred to an assembly "Microsoft.Office.Interop.Outlook"(which is added via: Add references -> COM -> Microsoft Outlook Object Library 11.0). However, the second machine cannot find the assembly and I have to manully change it to "Interop.Outlook"(which is also added via: Add references -> COM -> Microsoft Outlook Object Library 11.0). And I have to do some modification to the codes in order for the project to build successfully.
Why did the problem occur? What's the reason behind it?
OctopusThu
|
|
|
|
|
Hi everybody,I'm new here and I have a question... I'd like to create a form which would simulate a perspective view, so my form will have to have a trapeze shape. I don't want to use Region(myShape) because that will clip my form and I want to have the entire form.
Thanks in advance for any suggestions.
|
|
|
|
|
U have to create a image of the same shape as u want the form to be.(set some color in the image region e.g. black)
then set this image as the background image of the form.
and then set the transparency key of the form to the image's color i.e. Black
Hope that works for u.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
10x for the suggestion, but as I said, I want to know if there is a way to reshape the form, I dont want to use transparency keys or to overwrite OnPaint method
|
|
|
|
|
How Can we configure icon Files to asp .net web applications using C# Codebehind confused: :
|
|
|
|
|
Hello, friends
I want to know how to create a chm help file ahe how access it through
C#.Net.
Rahul Kulkarni
|
|
|
|
|
Assuming that you want to create a help file from your code, you need to document your methods with the XML document markup, e.g:
public void DoSomethingInteresting()<br />
{<br />
}
You also need to set your project to produce the XML markup in the using /doc. To do this, select the project properties then Build and switch the configuration to All Configurations. Assuming that you are using VS2005, you need to check the XML documentation file checkbox and enter the name of the project in the corresponding textbox.
Next, do a build to produce the XML documentation.
Finally, you need to use something like Sandcastle to convert the XML to CHM. I would suggest that you do a search for Sandcastle on CP to find articles on using it.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I need helpwith marshaling.
I have a c# application talking to c++ dll.
I am using a dllimport and in one of the API parameter,
I need to use a struct inside struct. I pass the referance of the struct and struct gets populated by dll.
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct Record
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] array1;
};
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct List
{
public uint numberOfRecords;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public Record[] Records;
};
Is this ok ? will it have 32 x size of record or does the marshalling say the list structure has total 32 bytes ??
please help.
-KK
- KK
|
|
|
|
|
Hi,
I'm trying to compare the contents of two Excel files. I've been able to export the contents of both files into separate datagridViews but please how do i compare both grids using two a column as the pry Key and checking for variations in the third column?
please i need this urgently.
Thanks all.
'Tilewa
|
|
|
|
|
How did you fill the grid(s)?
|
|
|
|
|
i have a long class that does this. it is actually in a library.
essentially, it uses an OLE connection (Microsoft.Jet.OLEDB.4.0)
'Tilewa
|
|
|
|
|
do a foreach and compare the rows/columns of the grids. you can also do this with the dataset or datatable before you fill it instead.
hope that helps some.
|
|
|
|
|
Hi, I have a question about the Windows Forms Timer class.
Suppose that the timer's interval is set at say 10ms and the work it does in each tick takes longer than 10ms to complete.
Is each tick executed on a separate thread? If not, then what happens?
|
|
|
|
|
Im guessing the next Tick will be delayed. Good question.. You can experiment with two timers and two counters .. the one with the lower count would be the delayed function.
|
|
|
|
|
|
So the tick executes again if it cannot complete it's work before the next tick is called?
|
|
|
|