|
1. How to retrieve the needed row from DataGrid?
2. How to change wide of each column?
thanks
|
|
|
|
|
You can get selected row index....
To change wide of colume, you can create column styles.
hope this helps you...
- ashish
|
|
|
|
|
for selecting a particular row from datagrid use this coe
private DataGridCell myCell=Datagrid1.currentcell;
TextBox1.text=this.Datagrid1[myCell.Rownumber,0].ToString();
0=coulmn number
this might be helpfull for u
Naveed Kamboh
-- modified at 19:41 Wednesday 21st September, 2005
|
|
|
|
|
I made a notify window application, works well, but when I do a shutdown my workstation at the end of the day, the application will not shutdown, leaving windows XP SP 2 hanging unable to shutdown. Have to manually shutdown the app, then windows will shutdown, without any problems. Any ideas on how to fix this problem?
|
|
|
|
|
You have to release resources of the application on closing it put an event for closing of the main form of your application and put this code inside it
<br />
system.Enviroment.Exit(System.Environment.ExitCode);<br />
to release all resources of your application on closing or it will still working in a hidden mode in your processes of your Os.
Miss With The Best And Die Like The Rest
|
|
|
|
|
|
Hello everyone!
I'm really in need of some professional help here. I'v created at transparent richtextbox, using this article:http://www.codeproject.com/cs/miscctrl/TransparentTextBox.asp?df=100&forumid=128070&exp=0&select=977976
As some of the users point out, the box does funny things when you scroll. I then overrided the OnVScroll, and this almos solved the problem. If you use the two up and down buttons in the scrollbar, or use the mouse to scroll the box updates with no problems. BUT if you use the bar it self, the scrollbar, then noting happens,and the text is screwed.
I really hope someone can help me with this!!!!
Thanks in advance.
|
|
|
|
|
I am working with Sockets – I find this interesting, and I would call it a bug. It seems odd that the bytes that comes from GetAddressBytes is not valid for creating a new address given the prototype for it is the same. (A System.ArgumentException is thrown) let me know if you find this odd, a bug or if I am just not understanding how to use this interface correctly.
using System;
using System.Net;
using System.Net.Sockets;
using System.Windows.Forms;
using ThreadingEx;
namespace foo
{
[STAThread]
static void Main(string[] args)
{
IPHostEntry Host;
IPAddress Address;
IPAddress Address2;
Host = Dns.Resolve(“AnyAddressThatResolves.com”);
Address = Host.AddressList[0];
/*
** This will cause an error, the prototype is
** public IPAddress(byte[] address);
** and the GetAddressBytes is
** public byte[] GetAddressBytes();
*/
Address2 = new IPAddress(Address.GetAddressBytes());
}
}
|
|
|
|
|
|
I'm trying to get my head around objects and am asking for thoughts on this
idea.
If for example I were to implement a Person Object, there may be differnt
Person objects representing people of different cultures.
All Person objects have similar characteristics, ie Height, Weight, Age ect
but I imagine that there could be a method ie SayHello which Person objects
of different cultures would implement differently.
Now what i'm trying to figure out is whether the Person Class should be
abstract to cope with different cultures or whether I should create an
interface or both.
Thoughts and comments appreciated.
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
LearnVisualStudio.Net
|
|
|
|
|
Although you could implement it with interfaces, a simple virtual method for SayHello, or other methods, would be simplier.
|
|
|
|
|
Hello
I don't think there are any requirements for using interface in your case.
You can create your base Person class, with a virtual SayHello method. You can provide it with default realization (may the person can greet you on some kind of default language of human being saying "Mmmm" or with some other action). Then, any other class, which will inherit your base class, can override the method. Or you can make the method abstract to make it obligate to provide realization of the method.
With best regards,
Andrew
|
|
|
|
|
Why make the SayHello method virtual? Could you noy just Override the method in the derrived class?
I understand that making it abstract forces the derrived class to implement the method in its own way but again, could this not also be achieved by Overriding the inherited method?
Is there a benefit or forefeit to either approach?
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
LearnVisualStudio.Net
|
|
|
|
|
You can only override a virtual method. That is the reason for making it virtual.
---
b { font-weight: normal; }
|
|
|
|
|
I agree with Andrew, I think that would be the best way to solve this requirement. You can override the method of sayhello of base class and implement it in the child class
Regards,
Jaiprakash M Bankolli
|
|
|
|
|
the rule of thumb is:
class inheritence is used as "is a" ... "an american IS A person"
while interfaces are more used in a context of "can perform something"
"money is cloneable" (where you might have ICloneable)
//Roger
|
|
|
|
|
Hi. I'm writing console application and I want to use MessageBox in it. I'm addins System.Windows.Forms namespace but i cant use MessageBox in my program. When I try directly call members of System.Windows.Forms there are only three 'WebBrowserPermision*' and nothing else.
Can anyone tell my why and how I use MessageBox in console app?
thx.
|
|
|
|
|
Can anyone tell my why
Why? That's a good question. A console app is not a Windows App and can't be forced to be one. You could create a Windows app that has a hidden window and create a cmd prompt to run your console app. But why go to the trouble, do you really need to have a console app?
|
|
|
|
|
If you really need it, add a reference to System.Windows.Forms, then you can use the reference to do a MessageBox call. But I question why you would need to do this; a console application shouldn't be using UI components for several reasons.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
I want to use a MessageBox in separate class to report exceptions like "file not found" but I test this class in console application.
I started learing C# today, so its hard for me to understand what should I do without example.
Reference? Uhm... in C++ I only had to add #include <windows.h>
|
|
|
|
|
Are you using Visual Studio? If so, right-click on your "References" folder in the Visual Studio Solution Explorer, and click "Add Reference". Find the System.Windows.Forms.dll and add a reference to that. Now you can use anything in the System.Windows.Forms namespace.
The reason .NET is broken up among several dll files is that loading a single large dll is too costly, and most developers wouldn't use even a quarter of the functionity available in the big dll. So Microsoft split up the framework into chunks: System.dll, System.Xml.dll, System.Windows.Forms.dll, etc. If you need functionality from those, you add a reference to that dll.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
Thx a lot, that's exactly what I needed
Strange that it wasnt mentioned in any book/tutorial I read.
|
|
|
|
|
.NET includes a way to encrypt something with RSA private key
and decrypt with RSA public key?
or do I have to use an external component
anyone has references or code snippets?
thanks in advance
|
|
|
|
|
|
Well I did checked MSDN, but since I have never used this namespace I have the doubt, the RSA implementation in .NET asks the public key to encrypt and private to decrypt but I need the opposite
the private key to encrypt and the public one to decrypt, is this possible?
-- modified at 16:06 Tuesday 20th September, 2005
|
|
|
|