|
yes this a question .... thx for your quick reply...thx
Mazhar Hussain
|
|
|
|
|
I have a TextBox inside a windows form (C#) which has capture property set to true. The TextBox captures the mouse events fine until I click inside the textbox itself, after which it does not respond to the mouse event happened outside its boundary. I checked the capture property and it is automatically set to false.
Thanks in advance
Manobal
|
|
|
|
|
Just out of curiosity, do you have a Click event handler for your TextBox.Click event? What is it doing? If so, you should put a breakpoint at the first statement of your handler and put a watch on the Capture property of your object and see when it changes. Examine the line before the change occured.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
No there is no click event declared for the textbox.
The TextBox is used to rename XYZ. So when a user choose to rename XYZ the textBox is enabled and user can write into it. Now If user is done renaming XYZ, he/she will click outside the boundary of textbox and I will disable the textbox. I am trying to make it similar the way it is done in windows to rename files.
The problem arises when I click inside the TextBox. It stops capturing the mouse events (Even though I set it to true) and I don't get mousedown event that occur outside textbox... I can not disable the textbox
Hope I made myself clear..
Thanks
MAnobal
|
|
|
|
|
It would be much simpler to handle the LostFocus or Validating event to disable the TextBox .
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi
Is there any one who can tell me how to get the port of an application with the application e.g i run an application and want to see on which port it is running by clicking the button with in that application
|
|
|
|
|
If your application binds to a port in order to listen, your application should already know which port and / or address it's binding to, or if you specify 0 for the port and IPAddress.Any for the address, you can retrieve the Socket.LocalEndPoint property to determine which address and port were selected by the service provider.
If you're connecting to another sock (and have not used Bind to pick a specific port), you should still be able to use Socket.LocalEndPoint to determine which address and port were used.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I need to copy files from a directory on our network out to a FrontPage Web's folder. Any tips/ideas on how to do this? The object browser is starting to give me a headache as I can't find anything to Open a web connection.
- Adam
|
|
|
|
|
This is a question better suited for the Web Development forum as it has nothing to do with C#. Please post in the appropriate forum next time, please.
You can, however, simply type a URL in the Open dialog box and a new web folder is usually created, but not necessary. FrontPage uses the FrontPage Server Extensions to connect to IIS (not simply WebDAV). You should also make sure that the FrontPage Server Extensions appropriate for your version of FrontPage are installed on the server with IIS installed.
If your FrontPage site is comprised of files from the network, use File->Publish and you're provided a number of options in which to publish the site to a FrontPage directory (see the paragraph above as it still applies) and most likely WebDAV and FTP depending on your version of FrontPage.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath,
I think my question was misunderstood. I am developing a C# application that will search a file system and then I want to automatically push the files found out to a web site that has FrontPage extensions installed. I know it is possible to connect to a site in this manner (Frontpage instead of FTP), I just don't know how. Can anyone help?
|
|
|
|
|
Misunderstood? You never mentioned that you wanted to write a program that did this. It helps to ask the right question.
There's no easy way to do this: the .NET base class library does not support FrontPage extensions (nor should it be expected to). You'll have to create a class library that uses the FrontPage protocol or search for one on google. The protocol is very poorly documented.
You could use WebDAV instead, which is a well-documented and industry-standard protocol. See http://www.webdav.org/[^].If you google well enough, you'll probably even find a .NET library you can use, but again it is not supported in the .NET base class library.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I didn't believe it necessary to state the obvious, that I was writing a program to do this, considering I was in the C# discussion board.
I appreciate your assistance in this. You are correct, I want to use the FrontPage protocol to do this. I am looking for people who have used it before. More specifically, the Office PIA now appears to be what I would require.
If you have and are capable of giving a more detailed explanation, great.
|
|
|
|
|
No, it's not obvious because we get unrelated questions like "how do I use frames in my HTML document?" all the time. Trust me - I spend a LOT of time in here.
The majority of people that have used the FrontPage protocol before were using FrontPage. Even the Apache server project had to be given a FrontPage mod by Microsoft themselves in order to support it (last I knew, it was written by an MS employee with permissions without support from MS themselves).
The Office PIAs don't expose what's necessary for the FrontPage protocol to be used through the object model - read the documentation[^] of the object model on MSDN and you'll see that. To get an instance of anything using Microsoft.Office.Interop.FrontPage you need an instance of the FrontPage.Application object, which is an out-of-process automation server (a .exe executable, namely frontpg.exe). So this won't be using the FrontPage protocol but FrontPage itself. It this is not a problem, then follow below. Otherwise, google for the API documentation if you can event find it, or visit the http://www.apache.org[^] project and look for the FrontPage extensions mod.
If you want to use FrontPage to publish the web, then create an instance of the ApplicationClass . Get the Webs property and call Add to add a file:// URL to the root network directory, which also returns a WebEx instance. That has a method called Publish that you can then use to publish the folder (and its subfolders). Call Close on the WebEx when done and call ApplicationClass.Quit (implements _Application.Quit ). This is roughly how all the Office applications work. If you have any experience automating Office (and I have lots) this becomes very easy because they are all architected about the same.
You won't find specific object model documentation for FrontPage, but you can use the concepts in the Word object model and apply them here, because as I said they are very similar in concept and architecture.
Microsoft MVP, Visual C#
|
|
|
|
|
I have a C# application that interops with PowerPoint 2000 (Project references description is "PowerPoint 9.0 Object Library"). I know that this app does not work on a PC that has PowerPoint 97 installed. Is it likely to work on a PC with PowerPoint 2002 (XP?). I know that COM is based on contracts of interfaces, so I guess later PowerPoint objects would support earlier versions' contracts, but is the interop generated by the IDE clever enough to deal with this too?
Thanks for reading.
--
DaveDG
|
|
|
|
|
The Runtime Callable Wrappers (RCWs), or COM interop assemblies, generated by .NET Framework tools and the IDE are attributed with the interface and class GUIDs defined in the typelib that you're importing. So, just like COM, if a newer version of a library supports the older versions of the interfaces, you can use the new library through the old object model since the contract is honored.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Does anyone have experiece with using ms access databases with C#?
I was wondering how fast and efficient the access is.
I am writing AI for an AI tournament and was considering using an MS ACCESS DB to store stuff. However, our moves have to be made in 6 secs or less..therefore it has to be fast access if I used this approach
|
|
|
|
|
mweston wrote:
I was wondering how fast and efficient the access is.
If you want to use it only in a desktop, its effieient enough and not as expensive as SQLServer, you can also use MSDE which I think is free and its SQL engine.
Mazy
No sig. available now.
|
|
|
|
|
MSDE is the Microsoft Desktop Engine, and shares most of its components with SQL Server. This can be a hefty install, though. It is definitely faster than Access (and has specialized classes for access it through ADO.NET using the System.Data.SqlClient namespace elements) but it's only free if you have a license for a qualifying product like SQL Server, Access, FrontPage (last I checked), Visual Studio .NET, and perhaps a few others. You can find more information at http://www.microsoft.com/sql/msde/[^].
As far as the speed of Access is concerned, you have to take account for a few things. First, to access Access you must use the generic OLE DB support in ADO.NET (using the Access OLE DB provider) using the System.Data.OleDb namespace elements. This provides generic access through the abstract OLE DB provider implementations so some things you can do in Access won't be possible through ADO.NET. Second, it depends on whether you use a DataSet (think of it as a disconnected recordset) or an OleDbReader . A DataSet takes a while to construct (less if you use a strongly-typed DataSet which you can create in VS.NET easily enough) but provides many advantages like serialization, filtering, relationships, referential integrity, and more. If you use an OleDbReader , it will increase access times but then you must parse and relate (if necessary) any data you read yourself.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
mweston wrote:
However, our moves have to be made in 6 secs or less..
It sounds like your tournament involves a strategic 2 player adversary game? Possibly checkers or connect four? If this is the case then I would definitely recommend against using a database. What exactly are you needing to store?
|
|
|
|
|
Actually we're playing Pentagonia
http://pentagonia.freeyellow.com
I was considering using a database to store past games to try to generate a self-learning AI. However, being new to AI, I am not 100% sure of anything at the moment. =) But, I AM learning.
|
|
|
|
|
I am trying to add an existing resX file to my project and it won't take. Any reason? Are this added differently or create in some other way (new to this .NET stuff)
thanks
Ralph
|
|
|
|
|
What do you mean "it won't take". Please be more technical, as this is a technical forum.
If you mean it won't compile to a .resources file and get embedded in your assembly, right-click on the file, select Properties, and change the Build Action to "Embedded Resource".
If you're new to .NET, you should definitely read the .NET Framework SDK. It contains many topics - including localization with resx files - and the class library documentation for the .NET Framework itself. See http://msdn.microsoft.com/netframework/using/[^] for more information and links to the .NET Framework SDK on MSDN Library Online.
Browsing the MANY articles here on .NET and C# on CodeProject can also be beneficial. There are many examples and code-snippets for all levels of programmers. Just browse the relevent categories.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks I will take a peek but I will reiterate. I have 2 projects and am moving some controls from 1 to the other. In the first project, there are a bunch of .resX file in the project tree. I copy those files to my new project directory, try to add them like I would any other file (via context menu). Basically it doesn’t add it to the tree like on would expect. I can add cs files, etc, but not these .resX files. I hope that is a bit clearer.. sorry for the confusion…
|
|
|
|
|
Again, what is the exact error? What exactly won't work? Please be specific.
If you're copying those to your new project directory and trying to add them into that project, you should expect a "file exists" error. Instead, show the hidden files for that project by selecting an item in that project and click the Project menu, then Show All Files. Find the resx file in that directory, right-click, and select Include in Project.
Make sure you take the namespaces changes into account if you didn't override the default namespace for your project (if necessary) in the project configuration settings (right-click on the project and select Properties). In VS.NET, resx files are created using the root namespace of the project, followed by any directories in which the resx files are located, and are finally compiled to .resources file with the namespace and filename prepended.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I clicked show all files and I do see although it looks like it is a link of some sort. I will take a look at the link you sent me....
thanks
Ralph
|
|
|
|