|
Thanks Dave for your reply!
Well GeClassname only gives name of the class like "Edit" for text boxes. So in that case we can not figure-out what text box had what value. e.g. Text1 was having value 'abc' and Text2 was having value 'xyz' etc.
Can we use something other than Win32 APIs in this situation?
Thanks for your help.
Niranjan
|
|
|
|
|
The only other identifier is the control's ID. The problem with that is that it changes from run to run.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I want to make my form NEVER_Minimizable
to do that.....i;ve done this:--
Protected Overloads Overrides Sub WndProc(ByRef msg As Message)
If msg.Msg = WM_SYSCOMMAND Then
If msg.WParam.ToInt32 = SC_MINIMIZE Then
Else
MyBase.WndProc(msg)
End If
BUT, This never handles Windows + D (Show Desktop) keys..
How to handle that ??
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
Hello all!
I've been a user here at TheCodeProject for a long time but have never submitted anything. I think its time for me finally to give back. I recently have been working on a tutorial for adding software/serial key registration protection to .net programs. I was wondering if you as members of the community would find this useful? If not, what other topics would you be interested in having an article written about? Thanks for your time and responses.
|
|
|
|
|
Hi,
I have been trying to ctach an click event on a ListView when the cursor is not present on any items. I tried the Click and MouseClick events but I seem to do something wrong and the event does not fire off.
What I have been trying to do is to create a ListView which has rows added to it at run time based on the context menu. The context menu Has to get enabled or disabled based on some external condition. what I have done is I have put this code to enable or disable the menu in the click event. but I observed that I was not getting the event if there are no rows present in the list view and the event seems to work when there are some rows and the click is performed on the row. can anyone let me know what I am doing wrong.
Regards,
Vijay
|
|
|
|
|
Frndz,
In my ASP.NET 2.0 app I have a text box (used for entering amont). I do not want user pasting any text (Ctrl + V) on that text box.
So how do we avoid user pasting any text on text box?
Regards,
Vipul Mehta
Sr. Software Engineer
NIIT Technologies Ltd
|
|
|
|
|
You could Javascript it. So on Keyup you catch for Cntl-V. Or you could catch OnChange and then compare what is in the Clipboard with the value of the text box. If its the same, then clear it out.
|
|
|
|
|
There really is no good way to do what you are asking for. Perhaps if you tell the reason for why pasting would be prohibited, it might be easier to give an answer.
---
b { font-weight: normal; }
|
|
|
|
|
Since that asp text box control is for entering Quantity (which will be only numeric). I had alos written a JavaScript function on keypress of that .net textbox control to avoid any charecter other that numbers.
So by chance if user pastes the text & clicks Save button it gives type casting error(which is quite obvious).
So instead of checking on codebehind I wanna do it before saving.
Regards,
Vipul Mehta
Sr. Software Engineer
NIIT Technologies Ltd
|
|
|
|
|
Check the value using the onsubmit event, then. Here is an example:
http://www.guffa.com/Programming_archive.asp?id=28
You still should validate the data the server side, though. You can never really trust that the posted data actually comes from your page, or that the Javascript validation always works.
---
b { font-weight: normal; }
|
|
|
|
|
The following logic has solved my problem
<input onPaste="return false;">
Thanking you for your prompt and useful reply
Regards,
Vipul Mehta
Sr. Software Engineer
NIIT Technologies Ltd
|
|
|
|
|
That is an event that only exists in Internet Explorer. Any other browser will ignore it.
---
b { font-weight: normal; }
|
|
|
|
|
I'm trying to get the VSS bindings for projects in a solution from the EnvDTE object. There is a SourceControlBindings object but I can't find any documentation on it. I can get the Bindings by cracking open the INI files for Non-Web Projects but not for Web Projects. There must be a better way! Any help?
|
|
|
|
|
I have a ComboBox which binds to a volatile collection.
When the collection is changed, the ComboBox (drop-down) list isn't refreshed if it has already been dropped down by the user.
If the user does not drop-down the list before the collection change, then it does a fresh read on the source and gets the correct data.
I'm wondering if there is a notification event that I need to raise other than the standard PropertyChanged to force the ComboBox to refresh. Note: The collection object has no access or awareness of the control (as it should be) so it can't be done manually.
Thanks
NIK
-- modified at 14:04 Friday 22nd September, 2006
|
|
|
|
|
I'm just starting to use Managed C++ and .NET. I'm still in the early learning stages.
Basically, I have a Window Form that has a value for MyClass to use. I thought I could use the following code to pass the Form1 handle to the Myclass constructor.
I forward declare the Form1 class in "MyClass.h". In the constructor definition I pass the Form1 handle to a local variable just to see if the handle gets to the construtor. When the 'myTestVar = ' line is commented out, the program compiles and when I run the debugger I can see the Form1 handle being passed to the constructor and hTest being set equal to hForm. So I know at this point, I can pass the Form1 handle to the constructor.
When I remove the comments from the 'myTestVar = ' line, I get compiler errors. I can't figure out what's wrong.
1>.\MyClass.cpp(12) : error C2027: use of undefined type MyProject::Form1'
1> c:\visual studio 2005\projects\praxflow\praxflow\MyClass.h(4) : see
declaration of 'MyProject::Form1'
Currently, I have a private member method within the Form1 class called setMyClass( ^Form1 ) which works but this doesn't seem very OOP to me.
//----MyClass.h----
#pragma once
namespace MyProject
{
ref class Form1; //forward declaration
}
public ref class CMyClass
{
public:
CMyClass( MyProgram::Form1 ^hForm );
private:
int myTestVar;
}
//----MyClass.cpp----
#pragma once
#include "StdAfx.h"
#include "MyClass.h"
CMyClass::CMyClass( hForm )
{
MyProject::Form1 ^hTest;
hTest = hForm;
// myTestVar = Convert::ToInt32( hForm->txtFieldFromForm1->Text );
}
//----Form1.h----
#pragma once
#include "MyClass.h"
namespace MyProject
{
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
//--- initializing stuff
}
protected:
//---destructor
private:
private: System::Void btnInitMyClass_Click(System::Object^ sender, System::EventArgs^ e)
{
CMyClass MyClass = gcnew CMyClass( this ); //Instantiate and initialize using the Form1 handle.
}
};
}
|
|
|
|
|
hi there
I'm a beginner into vc .net, and a have installed vs . net 2003 vc++....
Now I'm trying to find a crystal report tutorial or a sample code, but all I find is in C# or VB, i a wish to learn to do such kind of things in VC++...
how to search (find) samples in VC++ on msdn web site or here..etc
pls pls pls
alexa2g@yahoo.com
-- modified at 12:14 Friday 22nd September, 2006
|
|
|
|
|
If you have a specific question you would do better posting it in the VC++ forum. Code Project has a search articles capability.
|
|
|
|
|
|
What is the Top code in Dot. NET?
Hai this is Prabahar, working as a Software Engineer, in .NET Plateform for more than 3 years.
|
|
|
|
|
That's not a real question. Do you mean the best code, the best language, what ? I can't imagine a way to interpret it that gives it a cut and dried answer.
If someone asked me that in an interview, I'd say 'the code I'm going to write for you when you hire me'.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
First of all, is it possible usign .NET remoting feature inside a .NET
applet loaded into a tag object inside an HTML page ?
<object id="myID" height="150" width="300"
classid="http:applet.dll#test.applet">
If not please can anyone explain why ?
I think yes and so I'd written a small example immediately I've met a
problem.
I'm using .NET Framework v. 1.1.4322 and it's the only version
installed both client side and server side.
My test applet is correctly loaded into IE client but when I try to setting programmatically the remoting I aways obtain a SecurityException even if the assembly is strong name signed and client side fully trusted.
The exception is the following: <br />
System.Security.SecurityException: Request for the permission of type System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed. <br />
at System.Security.CodeAccessSecurityEngine.CheckTokenBasedSetHelper(Boolean ignoreGrants, TokenBasedSet grants, TokenBasedSet denied, TokenBasedSet demands) <br />
at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet denied, PermissionSet demands) <br />
at System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(IChannel chnl) at test.applet.Check()
Could anyone help me please ?
Best regards
|
|
|
|
|
1.I create a strong typed dataset.
2.I bound the table from the strong Typed dataset to a DataGridView.
3.User Click on a row and press "Select" button. I can just cast the selected row with code below:
<br />
this.returnedRow =<br />
(TypedDS.MasterGroupSearchRow)this.dgvMasterContract.CurrentRow.DataBoundItem; <br />
4.At this moment the
this.dgvMasterContract.CurrentRow.DataBoundItem is (TypedDS.MasterGroupSearchRow)
But if After Click on the column header .. problem come out ...
this.dgvMasterContract.CurrentRow.DataBoundItem will become System.Data.DataRow.
So code below will fail ..
<br />
this.returnedRow =<br />
(TypedDS.MasterGroupSearchRow)this.dgvMasterContract.CurrentRow.DataBoundItem; <br />
Is there anyway to solve this problem ? or is there anyway to preserve it original typed row ?
|
|
|
|
|
Check the type before you process the OnClick event?
Is this a web grid view or a winform gridview?
|
|
|
|
|
Hello!
Ive got a solution with about 10 projects. I recently changed assembly version in all projects from [assembly: AssemblyVersion("1.1.0.0")] to [assembly: AssemblyVersion("1.1.0.1")].
When I now rebuild the solution and run the program I get this: System.IO.FileLoadException: The located assembly's manifest definition with name 'X' does not match the assembly reference.
File name: "X"
What did I miss?
/Regards
|
|
|
|