|
Ah! OK. I've never seen the problem. Hmmm.... Maybe related to the old EnableVisualStyles problem?? Try something like this:
using System;
using System.Threading;
using System.Windows.Forms;
static class Program1
{
[STAThread]
static void Main()
{
Thread.Sleep(5000);
Application.DoEvents();
Application.Run(new Form());
}
}
Other than that, I've got no ideas. Sorry...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I made this way and now it works correctly. I now have Visual C# 2005 Express, but I had this problem in VS 2003 too.
Thanks.
|
|
|
|
|
Visual Studio .NET 2003, right? I can't duplicate the problem. Though, I'm just using a blank form and adding the Thread.Sleep(5000) line exactly where you have it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hai ,
I am Ravindra at present I am learning .net.
When I am working with .net controls ,I am not getting all the events loaded .
(ie) for suppose if i used button control,i am not getting all the events of that respective control loaded in code page.
Please help....
thanx in advance.
|
|
|
|
|
What do you mean when you say that you don't "get the events loaded"?
---
b { font-weight: normal; }
|
|
|
|
|
Are you saying that you're overloading events and they are not firing as yuo'd expect ? Which events ? In what circumstances ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
ravindradonkada wrote: When I am working with .net controls ,I am not getting all the events loaded .
If I read you correcly you are expecting all the event handler code to be made in advance? You either need to override the event or dbl-click the event in Visual Studio and it will regester a delegate. If can speak your native language I could translate it using the internet to better understand your problem.
static int Sqrt(int x) { if (x<0) throw new ArgumentOutOfRangeException(); int temp, y=0, b=0x8000, bshft=15, v=x; do { if (v>=(temp=(y<<1)+b<<bshft--)) {="" y+="b;" v-="temp;" }="" while="" ((b="">>=1)>0); return y;
|
|
|
|
|
Hi all,
I'm stymied by this one. I have a .NET Windows application programmed in C#. It has of course a lot of live data displayed on various forms, using the connector, adapter, and dataset tools. Plus, it does data manipulation in the code, programmatically setting up connections, adapters, and so forth.
Up to now, I've let this be fast & loose with the database, using the production database for testing, but now this has become an issue, and I have to split the development database environment away from the production one.
So the question becomes, how do I have, in all those connection & database definitions crawling throughout the product, a separate database for development & testing, possibly on a separate server? The idea of changing them all to deploy is just not good process, so there's got to be a real solution. Pointers and suggestions are most badly needed. Thanks.
Joe
I'm smarter than this makes me sound. Really.
|
|
|
|
|
Well, how I do it is I have a second copy of the database on my development machine running in a named instance of MSDE, or on the SQL Server under my desk.
The only thing that needs to change is the connection string, but only to specify which server/named instance the database is in.
If you've hard coded this connection string all over your code - shame on you for using such bad practice!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Try this
>> Use connection strings in code for connections
>> Store the connection details in an XML file in the application directory, Fetch details from this file during connection.
>> You have to only change the XML File to change the database name
"I firmly believe that
any man's finest hour,
the greatest fulfillment of all that holds dear,
is that moment,
when he has worked his heart out in a good cause
and lies exhausted in the field of battle - victorious..."
|
|
|
|
|
Greetings:
I'm not sure if this is the proper forum for this question but I'll ask anyway:
I have downloaded the demonstration version of Dundas Charts and have been playing with them for a week or so. I like what I see so far and am considering purchasing a license. I am wondering about tech support however. Has anybody used Dundas Charts and, more specifically, has anybody encountered a problem that required tech support? How did that go? How quick were they to respond? How helpful were they? How many layers of know-nothings did you have to peel through before you got to correspond with somebody that could help you? What was the average number of hours / days from the time that you initiated contact to the time when the problem was resolved?
Thanks in advance,
Mark
|
|
|
|
|
I tested the charts, and I contacted support, I didn't tell them I worked for CP, because I didn't have to, the support seemed excellent.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
How to get the name and value of the control belonging to window in some other program?
Currently I am trying it with Win32 APIs. Here are the steps I am foloowing.
1) I am using 'FindWindow' function to retrieve the Handle for the target window.
2) Then I am using 'EnumChildWindows' to get the controls in the traget window.
3) Then I am using 'WM_GETTEXT' in 'SendMessage' function to get the value for the control.
But I also need name of the control so that I can Identify what control has what value. What function can be used to get the name of the control? How to achieve this using Win32 APIs?
Thanks.
Niranjan
|
|
|
|
|
There are no names in the sense you're thinking of. You'd be looking for the class name of the window you want to get. GetClassName[^]
As for value, not every control responds to WM_GETTEXT and there is no Value property that you can get either. If WM_GETTEXT doesn't work, you'd have to investigate other possibilities, like doing some serious debugging of the target app and digging around to get at the location where the control stores its data and try and grab it by directly reading memory. No, I don't have any example code.
Basically, there is no one method that is going to work for every control. What you want to do is problematic and not very reliable.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
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
|
|
|
|