|
my is not working.
private void tvwLeft_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
TreeView box = sender as TreeView;
}
}
}
I wanna make the node that I right click on it to be the selected node.
|
|
|
|
|
I got it
private void tvwLeft_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
TreeView box = sender as TreeView;
tvwLeft.SelectedNode = box.GetNodeAt(e.X, e.Y);
}
}
|
|
|
|
|
Has anyone figured out how to add a bitmap to a listbox header column in C#?
Maria Ward
|
|
|
|
|
MariaWard wrote:
Has anyone figured out how to add a bitmap to a listbox header column in C#?
Sure, you should be able to do something like this with a image list:
listView1.HeaderImageList = headerImageList;
listView1.SetHeaderIcon(0, 0);
Take a look at Carlos H. Perez's article on C# Sorted ListView[^] for more of an example.
Nick Parker
Not everything that can be counted counts, and not everything that counts can be counted. - Albert Einstein
|
|
|
|
|
Anyone using it?
AppUpdater[^]
I am having a few problems with it and GOTDOTNET appears to have broken their message boards.
PROBLEMS:
1. Kinda works when debugging, however it always tells me there is an update available - even when server has the same version as client.
2. Fails miserably in Release mode.
I have an UpdateVersion.xml on the server that says the next version is 2.0.0.0 and in the /2.0.0.0/ directory. However, the program downloads the 1.0.0.0 version from the /1.0.0.0/ directory. On top of that, it puts the update in a /1.0.0.0_1/ directory on the client. Which is curious because it downloads the UpdateVersion.xml file from the server that contains the 2.0.0.0 information. The log file just keeps repeating "Successfully updated version 1.0.0.0"
--
If it starts to make sense, you're in a cult.
|
|
|
|
|
Hi,
If you log into irc on Efnet and go to #ms.net you can ask either ^CareBear or Wilco about this since they've dissected this example and even made their own variant.
Nathan.
|
|
|
|
|
Hi!
I have a real problem. (Sorry for my english.)
I want to make a client side usercontrol like an activexobject
with C#. ( Client has framework too)
There are several examples on the net
(http://www.mastercsharp.com/article.aspx?ArticleID=70&&TopicID=14
...etc).
!!!BUT!!!
Never worked any of them!
I open the website, and the control seems like to be a simple textarea!
I suggested, there was a problem withinternet options.
But all of them (Local intranet zone, and internetzone are allowed for everything,IIS settings are more than correct for enableaing everything to do with the site. And there is no control.)
Please help me! Maybe the settings of the trusted assemblies of the framework are bad??? or what's wrong with that?
( some enviromental:
.NET studio 7.0.9466
framework 1.0.37.05
IE 6.2800.1106 /SP1;Q328970
Win2k server 5.00.2195 SP3)
Time getting to be to late! Please Help Me!!!
Agyklon
|
|
|
|
|
Security is your problem. The default security setup on a .NET install assigns no permissions to code downloaded from the Internet (specifically the permission group Nothing ). Your options are:
- Reconfigure the security on your machine (not really recommended)
- Add your site into the list of Trusted Sites
You can configure your security settings by opening the .NET Framework Configuration console (under Programs / Administrative Tools on my Win2K box) and then open Runtime Security Policy / Machine / Code Groups / All_Code / Internet Zone, click on Edit Code Group Properties and go to the Permission Set tab. Here you can choose what permissions to allow code downloaded from the Internet. For a really good explanation of all this, check out Don Box's excellent MSDN Magazine article[^].
Adding your site to the list of Trusted Sites is done through Tools / Inernet Options / Security from Internet Explorer.
Either way there's going to some setup needed on machines accessing your site. Sorry.
I seem to recall that the default security policy changed in SP1. Not entirely sure of this though. And I don't really know much about what happened in SP2.
|
|
|
|
|
Hi.
It's me again, Peter.
I've tried an other lot of couple variations of settings,
at the adminstration tool, without any success.
I've rebuilded the code.
The site is trusted as well,as the code is trusted.
I haven't any more idea.
Maybe I should ask the Microsoft for it. Or have you done a real working example before?
I haven't seen any example before, what works.
well..
Please help if you have done some working client side usercontrol!
Please tell me the steps where I was fault.
(Sorry for my english )
Agyklon
|
|
|
|
|
Hi!
It's me again.
I found sum helpstuff:
[1] - http://www.gotdotnet.com/team/windowsforms/iesourcing.aspx
[2] - http://msdn.microsoft.com/msdnmag/issues/02/01/UserCtrl/default.aspx
At the IIS was something wrong. ([1]/3.)
There must be only for script executeing rights.
Now, the control is downloaded.
I can found it the cache: gacutil /ldl
but, i can't see everything, it appeares like just a missplaced image.
Site is trusted, there is new codegroup rights, and
i can found all of the rights at
framework configuration/runtime sec/right click/evaluate assembly.
suggestion:
more missconfigured parameters at IIS???
Agyklon
|
|
|
|
|
Try also looking at http://msdn.microsoft.com/msdnmag/issues/02/06/Rich/default.aspx[^]. This will provide you with a sample download that you can play with.
Assuming you have everything setup properly, my next guess would be that your code is throwing an exception that it is not handling. This could be because of security (see below) or simply a problem with your code. Make sure you have try..catch blocks everywhere and try attaching VS.NET to IE before you load your web page - this may enable you to debug your control.
Your code will run in a partially trusted environment, so certain things (e.g. disk access, registry access, web access anywhere other than the site where your control lives) are off limits. Your code will throw an exception (probably a System.Security.SecurityException ) if it attempts these tasks.
|
|
|
|
|
Bet you guys love me now huh?
How is this used MSDN says squat about it (ok not squat but it might as well be ). I remember reading somwhere in one of my books about it being able to tell windows you will be handling certain key presses (like the cursor keys) so it will not take over in the next hooking phase. But dammed if I can find out...
|
|
|
|
|
Hi,
This may help. For the KeyPress event of the control:
private void tbMsg_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if( e.KeyChar == ( char )13 ) // (char)13 is the return key.
{
// Tell the system that the keypress has been handled.
e.Handled = true;
// Do something. Here I'm simulating a button press.
button1_Click( this, e );
}
}
Nathan.
|
|
|
|
|
I'm trying to constrain a graphics object in a panel control (like drawing a square that moves in the panel that stops at the panel line) I am trying to use the Panel.Left and Panel.Right etc in a
if (x <= Panel.Left)<br />
x = x - 10;<br />
else x = Panel.Left;
but it is not constrained by this... Is there another way? The rectangle structure is Rectangle(x,y,10,10)
|
|
|
|
|
My guess is you will have to use a combination of mousecapture and hittest.
Cheers
Kannan
|
|
|
|
|
I figured it out my problem wasn't that I was going outside the panel it was the line redrawing when it hit the side and erasing the part by the panel.
|
|
|
|
|
how to programmatically trigger off an menu item
event?
someone told me that i should
-----------------------------
System.EventArgs args = new System.EventArgs();
this.menuitem1_Click(this, args);
-----------------------------
but i dont think this is correct since this is just executing an event instead of triggering it.
thank you.
regards
yccheok
|
|
|
|
|
You don't really want to trigger the event, you want to execute the code in the event handler. If this is something you will be doing often then have the event handler call another function or object method, which you can also call when needed.
|
|
|
|
|
Same thing in the end. "Triggering" an event due to the user pressing a key or clicking a mouse, eventually causes the event handler (menuitem1_Click in your case) to be executed. Actually, executing directly is much more efficient than when a user causes the event handler to fire.
Cheers
|
|
|
|
|
MenuItems have a PerformClick() method that might be what you're looking for. link[^]
|
|
|
|
|
Having just read Liong's article about using the Observer pattern for a chat server, I don't think that this pattern is appropriate for a situation involving remoting. After all, the GoF patterns were all about object interactions within an app.
Other than the Wiki (http://c2.com/cgi-bin/wiki[^]) which does my head in trying to find anything sensible on it , does anyone know of a catalogue of design patterns? E.g. some that apply to Remoting situations, others applying to other problem domains, etc.
|
|
|
|
|
|
There is a book called C# Design Patterns - A Tutorial that I have found really good.
It basically goes through the GoF patterns using C# examples.
Jarrod
|
|
|
|
|
I have arabic text in textBox1 and I need to convert it to Unicode in textBox2? is there any easy & fast way to do it?
Many Thanks,
Jassim rahma
|
|
|
|
|
Take a look at the System.Text.UnicodeEncoding class.
Nick Parker
Not everything that can be counted counts, and not everything that counts can be counted. - Albert Einstein
|
|
|
|