|
I checked your code .You must fix the line number 4 from
<br />
n.SelectedImageIndex = 4;<br /> to n.SelectedImageIndex = 1;
because your image list has only two images and the treeview can't display image for selected node
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
Hello again
Ok, I saw that and that was not the main problem, beacause i just typed wrong imageindex here and in my project it was correct.
Thank you for your advice.
|
|
|
|
|
Perhaps you've forgotten to set the Treeview 's ImageList property?
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Does imageList1 actually contain the images? Does setting the property using the Forms Editor work?
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
Hello
Everything is Ok, I have imagelist with icons (*.png,*.ico) and i set imagelist property of TreeView control. I have no problem in wizard mode.
It means when i add and set nodes and icons from properties window there is no problem. Problem accures in programmatically mode.
I think i have problem with pictures size or type, Can yo help me ?
|
|
|
|
|
Hi.
In almost all articles about Remoting, I saw namespaces "using System.Runtime.Remoting.Channels.Tcp" and "Using System.Runtime.Remoting.Channels.Http" and etc.
But when I want to use them, VS says that "A namespace does not directly contain members such as fields or methods".
Why ?
I using VS 2005.
Best wishes
|
|
|
|
|
Your problem is no tied with the question you asked.
You can not put a method inside a namespace like this:
namespace Something
{
public void DoSomething ()
{
}
}
methods can only be contained inside a class or a structure.
--------------------------------------------------------
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!
|
|
|
|
|
You need to explicitly add a reference to System.Runtime.Remoting.dll. VS 2005 automatically adds reference to System.dll and certain other dlls depending on the project type, that's why you might not have done that before.
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
hi everyone,
i'm developing 2 applications that can communicate to each other. application1 is using a tcp socket to send a message to application2. application2 should receive the message through its webservice. now, my problem is i'm not getting the message in application2. i tried running ethereal to check the packets and i can see that the message is going to the computer where application2 is running but i'm getting a Null reference exception on application2. i tried using stacktrace
but it's only giving me the line where the null reference occured no further information. so, i need advise what's going on. why am i not getting the message from the application? i have been working on this problem for a week now. so, please advice.
thanks.
|
|
|
|
|
Near to impossible to answer from your description. Please post the relevant receiver code and probably also the sending code (and don't forget to mark the line where the exception occurs).
|
|
|
|
|
hi,
thanks for your reply. i didn't post the code since it's very long. basically i only used BeginSend()(tcp socket) method to send the message and i get to this part of the other application :
//------WebService file--------
public string EndSendMessage(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((string)(results[0]));
}
//---Form.cs file---------
MyWebService ws = new MyWebService();
//other code here...
string str = ws.EndSendMessage(); //<---- string is null
I've been looking around for a code that works like this but i can't find one. Is it really possible to send a message from a TCP socket to a Webservice?
Thanks.
|
|
|
|
|
Hi
I have two form, a main form with a button, its text is Show. When click this button, it shows me the second form and the main form is hidden. The second form with a button, text is Show Main. When click it, the main form is shown. But I cannot do this.
Please help me!
Thanks!
|
|
|
|
|
How are you showing the second form? If you're using ShowDialog , then the second form is modal, so you can't show the first form when it is visible. You might want to use Show instead.
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
Using Vs2005, I cant get my custom paint to work during designtime.
Heres the example:
Start a new windows app.
Add a user control
Paste the following into the usercontrol code:
protected override void OnPaintBackground(PaintEventArgs e)<br />
{<br />
base.OnPaintBackground(e);<br />
<br />
Graphics gx = e.Graphics;<br />
Pen pen = new Pen(Color.Red);<br />
Rectangle rect = e.ClipRectangle;<br />
rect.X += 10;<br />
rect.Y += 10;<br />
rect.Width -= 20;<br />
rect.Height -= 20;<br />
<br />
gx.DrawRectangle(pen, rect);<br />
}
Build the project.
Ok, basically, I only see my custom paint if I drag my control into a form.
If I just want to look at the customcontrol designer screen, I dont see my custom paint.
Am I missing something? Am i supposed to set a flag somewhere, like Ownerdrawn?
Any ideas why?
Andy
|
|
|
|
|
That's normal. In design mode of a user control only the InitializeComponent function is executed - nothing else.
|
|
|
|
|
Hi
I am a beginner level programmer. I want to running and closing another program (Excel,Word,winamp etc) by command. How can i accomplish this? Can you help me,pls..
|
|
|
|
|
|
I have retrieved the data and it appears in my list box, but I do not know how to have the data listed in columns instead of horizontally. Can you advise me on this.
Thanks.
TippyMoe
|
|
|
|
|
Do you mean List View? Because as far as I know the List Box control doesn't support columns.
Sean
|
|
|
|
|
Thanks,
I am definitely looking for list boxes. I found what I needed. Thanks for your help.
Tippy
|
|
|
|
|
Had a look on ListBox.MultiColumn property?
|
|
|
|
|
Thanks, I will check that out.
|
|
|
|
|
I am having an issue with a loop. Basically what i'm wanting to do is copy the first path in listView1 then automatically move on to the next item on the listView1. I did some testing without the file.copy function in the loop and i am seeing it isn't moving to the next item. also it tries the same item again .
private void syncbut_Click(object sender, EventArgs e)
{
int filePathList = listView1.Items[0].Index;
int lv2name = listView2.Items[0].Index;
string fileName = listView2.Items[lv2name].Text;
string path = listView1.Items[filePathList].Text;
string path2 = textBox4.Text + fileName;
if (filePathList <= maxFilePath)
{
listView1.Items[filePathList].SubItems[2].Text = "Processing";
File.Copy(path, path2);
filePathList++;
lv2name++;
}
this.syncstat.Text = "Status: All Files Have Copied Successfully";
}
any help would be appreciated!
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Where is the loop?
The code you posted has no while,foreach or for loop...it will copy exatly one file (the first) each time it is called.
We need to graduate from the ridiculous notion that greed is some kind of elixir for capitalism - it's the downfall of capitalism. Self-interest, maybe, but self-interest run amok does not serve anyone. The core value of conscious capitalism is enlightened self-interest.
Patricia Aburdene
Bulls make money, bears make money, pigs get slaughtered.
Jim Cramer
|
|
|
|
|
whoops i thought i would be able to use an if statement to process the loop. I have modified it a bit now but now i am getting an error:
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in System.Windows.Forms.dll
Additional information: InvalidArgument=Value of '1' is not valid for 'index'.
private void syncbut_Click(object sender, EventArgs e)
{
int filePathList = listView1.Items[0].Index;
int lv2name = listView2.Items[0].Index;
string fileName = listView2.Items[lv2name].Text;
string path = listView1.Items[filePathList].Text;
string path2 = textBox4.Text + fileName;
do
{
listView1.Items[filePathList].SubItems[2].Text = "Processing";
File.Copy(path, path2);
filePathList++;
lv2name++;
}
while (filePathList <= maxFilePath);
this.syncstat.Text = "Status: All Files Have Copied Successfully";
}
i'm trying to get it to start with the first item of the listview [0] then move to [1] and so on till the last one (maxFilePath)
Don't be overcome by evil, but overcome evil with good
|
|
|
|