|
It'll make it so the Key* events won't fire when an arrow key is pressed but try moving the base.OnKeyDown call so its only called if the key wasn't an arrow key.
It could also be that the TextBox inside the cell is trapping those keys; so you're seeing the behavior of the TextBox and not the datagrid.
James
Sonork ID: 100.11138 - Hasaki
"Smile your little smile, take some tea with me awhile.
And every day we'll turn another page.
Behind our glass we'll sit and look at our ever-open book,
One brown mouse sitting in a cage."
"One Brown Mouse" from Heavy Horses, Jethro Tull 1978
|
|
|
|
|
I know this is dumb question,but I am beginner in C# and do not have any book about it.
I have a text box and a button,when user press this button I want to check if the text boxes are
filled or not,and if the text is empty,change the text of button,I use this but it does not work:
private void Button1_Click(object sender, System.EventArgs e)
{
if(TextBox1.Text==null)
Button1.Text="Hello";
}
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
try this one:
private void Button1_Click(object sender, System.EventArgs e)
{
if(TextBox1.Text.Length == 0)
Button1.Text = "Hello";
}
or set the Enabled-Property of the Button to false at startup
and override the TextChange Property of your TextBox maybe like this:
private void TextBox1_TextChanged(object sender, System.EventArgs e)
{
if(this.TextBox1.Text.Length > 0)
{
this.Button1.Text = "Click me";
this.Button1.Enabled = true;
}
else
{
this.Button1.Text = "Hello";
this.Button1.Enabled = false;
}
}
rgrds
Martin
|
|
|
|
|
Thanx,I check it now
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I think I made amistake about the place of my question,it's in a web form.My button does not enable when I add some text to text box???
Is there any difference between windows form and web application in this case?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I'm sorry, but I can't help you in this case.
On my new Computer is only Win XP Home Edition installed.
The Home Edition has no IIS, and without IIS i can't create Web-App's.
I planed to Upgrade to Prof. Edition but the 'Update' isn't cheap !!
So I hope that you can get help from another !!
Rgrds
Martin
|
|
|
|
|
Assuming VS.NET wired up your event correctly try changing your code to this:
if(TextBox1.Text == "")
Button1.Text="Hello";
Andy Gaskell, MCSD MCDBA
|
|
|
|
|
Thanks,that works
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Hi,
I am currently trying to dynamically create an instance of a class. My class has a member called XmlReturnData which is derived from XmlDocumentFragment.
Depending on the command which was sent to a client, XmlReturnData can be specialized as - for example - XmlReturnDataLogin.
A class called LoginCommand (derived from XmlCoammd which is derived from XmlDocument) calls its base methods ParseXml() passing the type information of the XmlReturnData - object to create:
Public ParseXml(ByVal returnType As System.Type)
At the end of the method, I am trying to create the appropriate instance of the return object:
Dim args() As Object = { Me, SelectSingleNode(<xpath>) }
m_returnData = Activator.CreateInstance(returnType, args)
Now, I'll get the following exception:
System.Reflection.TargetInvocationEception [...] <------ System.NullReferenceException
So, what can be Null here? The exception is not thrown by the constructor of XmlReturnDataLogin, because I even don't get there.
Kind Regards,
Michael
|
|
|
|
|
Michael Groeger wrote:
m_returnData = Activator.CreateInstance(returnType, args)
The documentation says the exception is thrown when the constructor throws an error; however I have found that it can be other things as well. When I wrote my "extend your .net programs at runtime with interfaces" article I was finding that sometimes I just needed to do a rebuild of all pieces of my project. It seems that the type the program expected was a different version than the one that was actually loaded.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Smile your little smile, take some tea with me awhile.
And every day we'll turn another page.
Behind our glass we'll sit and look at our ever-open book,
One brown mouse sitting in a cage."
"One Brown Mouse" from Heavy Horses, Jethro Tull 1978
|
|
|
|
|
Hi James,
I rebuild the solution, but the problem remains the same. But I found that there was an error in the constructor. I believed that I can break into the constructor from the call to CreateInstance() which was wrong. So I called New() directly and found the mistake.
Thanks for your help!
Michael
|
|
|
|
|
What are the rules for specifying the parameter types for Win API functions using DllImport?
E.g. this thing...
DWORD GetPrivateProfileString(
LPCTSTR lpAppName, // section name
LPCTSTR lpKeyName, // key name
LPCTSTR lpDefault, // default string
LPTSTR lpReturnedString, // destination buffer
DWORD nSize, // size of destination buffer
LPCTSTR lpFileName // initialization file name
);
How would I import that? would this be correct...
[DllImport("kernel32.dll")]
static extern int GetPrivateProfileString(string section,
string key,
string def,
string val,
int size,
string file);
|
|
|
|
|
There are two different versions of GetPrivateProfileString, one for ANSI strings and another for wide/Unicode strings; so you'll need to specify that.
Your destination buffer should also be a StringBuilder rather than a string.
There is a utility posted on GotDotNet that will generate the correct DllImport statements for you. You need a copy of the win32api.txt from VB6 though.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Smile your little smile, take some tea with me awhile.
And every day we'll turn another page.
Behind our glass we'll sit and look at our ever-open book,
One brown mouse sitting in a cage."
"One Brown Mouse" from Heavy Horses, Jethro Tull 1978
|
|
|
|
|
招标:用C#实现MSHFlexGrid
本公司是国内知名软件公司,因项目急需,向社会编程高手招标,开发一个实现全部MSHFlexGrid功能的控件,要求用C#实现。具体和工期价格可面谈,并签订具有法律效力的经济合同。
联系方式:ywc@ufsoft.com.cn
|
|
|
|
|
Oh man Chris is going to kick your ass when he sees you've hax0red his DB.
- Jason
Do you have a Pulse?
SonorkID: 100.611 Jason
|
|
|
|
|
I didn't understnd your mean, pls explain more clearly.
neil
|
|
|
|
|
LOL
Bow wow wow,
Yippee yo yippee yay,
My miniputt high,
Is now 30 yay.
|
|
|
|
|
You don't miss a thing, do you Nish?
- Jason
Do you have a Pulse?
SonorkID: 100.611 Jason
|
|
|
|
|
I don't know Chinese so I asked babelfish to translate for me, but it still isn't making much sense for me :-P
Tender: Realizes MSHFlexGrid with C# This company is the domestic well-known software
company, because of the item urgent need, programs the master to the society tenders, develops
one realizes completely the MSHFlexGrid function controls, requests to realize with C#. Concrete
and the time limit for a project price may speak face-to-face, and signs has the legal effect the
economic contract. Contact method: ywc@ufsoft.com.cn
Could you clarify? It looks like you are looking for someone to write a program for you but the translation gets terribly jumbled.
James
Sonork ID: 100.11138 - Hasaki
"Smile your little smile, take some tea with me awhile.
And every day we'll turn another page.
Behind our glass we'll sit and look at our ever-open book,
One brown mouse sitting in a cage."
"One Brown Mouse" from Heavy Horses, Jethro Tull 1978
|
|
|
|
|
Hi there,
is it possible to change the Back- and ForeGround Color of a ProgressBar-Control ???
The Property BackColor f.e. is not shown in DropDown List but in Help File the Properties
BackColor and ForeColor are shown however with Descrition "Overridden. See Control.BackColor.".
any Idea ??
thanks in advance
Martin
|
|
|
|
|
I have main program written in C++.
This is unmanaged code from VC++ 6.0
now compiled in VC++ .NET.
How to import C# function to
this C++ unmanaged code.
Thanks
Konrad Wicynski
|
|
|
|
|
I think it's not bad to take a look at "managed C++" part,
I think your answer is there.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Hi all,
I've got a DataRow inherited class like this:
public class CustomDataRow : DataRow
{
new public this[string columnName]
{
get
{
[...]
}
set
{
[...]
}
}
}
When compiling, Visual Studio shows this error:
"No overload method for 'DataRow' takes '0' arguments"
I tried to add a default constructor like...
public class CustomDataRow : DataRow
{
public CustomDataRow()
{
}
new public this[string columnName]
{
get
{
[...]
}
set
{
[...]
}
}
}
...but error continues. Any idea?
Thanks in advance.
|
|
|
|
|
DataRow does not have any public constructors, therefore your cannot derive a new class from it. This situation exists for many classes in System.Data and System.Xml namespaces.
Greg
|
|
|
|
|
Hi All,
I have a application created in C# that is working 100% on my Windows 2000 Prof with no bugs at all.
I have installed it on a NT4 machine with SP6 and most things still work but I am getting a few bugs.
For example.
I have some code that must run when a dropdownlist is changed.
On NT4 if they select something in the dropdown everything works fine, but if they drop the list and then click somewhere else they get an application error.
I cannot replicate this problem on my Windows 2000 box?
Can someone let me know why this happens?
Thanks,
Gavin Mannion
|
|
|
|