|
it try to use internetdial() to take numbers,but i can't because it take name of connection to dial with (existing connecton on pc) as a parameter
plz tell me how to make it take numbers
|
|
|
|
|
I am after a component that will enable users to resize visual objects such as an image at runtime. Just like in a standard art package.
I wrote 1 myself in Delphi and I could port it to C# but I am not sure how I would implement some of the Mouse capture routines...
Besides there must be an open source control that I can use/develop further to achieve what I want.
TIA and Merry Christmas
Luke
|
|
|
|
|
Jinwah wrote:
Besides there must be an open source control that I can use/develop further to achieve what I want.
Well, did you try searching for one? There should be plenty of examples here on CP.
Also, read the documentation for the System.Windows.Forms.Control class. That has all the mouse events and properties you need to do this.
-----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 am new to C#. I am developing a small windows application to train myself with. I faced an issue and can't figure out a good approach to it.
My application needs a few configuration settings that shall be available for altering from users interface. I can build a form etc. but the problem is that I don't know how to keep custom settings. I tried application configuration file, defining a custom section and using IDictionary class instance for reading them. Well, I can read them but can't save them as they only get saved in System.Collections.IDictionary and don't get saved in the application config file.
Is there any simple way to arrange custom configuration and read-write it?
Can someone share a simple understandable example of it?
I hope I explained it clear enough.
Thank you all.
|
|
|
|
|
Take a look at the "Isolated Storage" in the docs and also have a look at this[^] article.
Regards,
Kannan
|
|
|
|
|
I guess this might help and I am trying to read the article.
However, the code in the article looks bit complicated. Can you (someone) maybe give me a simple example of reading/writing a couple of settings?
like nick : real name?
thanks a lot lot lot!
|
|
|
|
|
The .config file is just an XML file, so use the System.Xml namespace elements to append/insert/delete your settings. Note that this will not update your configuration options while the process is running. For information on how to do that, search the comments for this forum for keywords like AppDomainSetup because I've already covered how to do this a couple times. Of course, you could always update your settings in the running, cached instance if you provide an instance property for your configuration section object (which the IConfigurationSectionHandler implementation creates) and update your UI accordingly.
-----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-----
|
|
|
|
|
Look at XML serialization. You can create an xml file that contains your app settings. You would simply 1. open a file stream 2. create xml formatter 3. serialize the settings you choose to the xml file.
Take a look at serialization. You could use the .config file but this is read only, therefore you cannot create a user interface to modify it.
|
|
|
|
|
And if the config file contained other stuff not for his section? This would NOT be a good idea because the other IConfigurationSectionHandler implementations provided in the .NET BCL do not use XML serialization. XML Serialization would wipe out the file and create a new one (based on your stream preferences).
-----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-----
|
|
|
|
|
For a simple solution take a look at my Profile article[^].
Regards,
Alvaro
He who laughs last, thinks slowest.
|
|
|
|
|
How can i create a new datatable in a database ?
We have a connection and a dataadaptor .
I mean programically.
Regards' Amir Jalaly
life is tow days'
one is paid for love someone '
and one day is paid for hate him'
|
|
|
|
|
|
I want to convert this code from vb.net to c#.net:
Declare Function ExitWindowEx Lib "User32" (Byval l as long ,Byval s as long ) as long or this:
Declare Function FormatMessage Lib "kernel32" Alias _<br />
"FormatMessageA" (ByVal dwFlags As Int32, ByVal lpSource As Int32, _<br />
ByVal dwMessageId As Int32, ByVal dwLanguageId As Int32, _<br />
ByVal lpBuffer As StringBuilder, ByVal nSize As Int32, ByVal Arguments As Int32) _<br />
As Int32
what is equal for Declare and lib in C#?
Regards'Amir Jalaly
life is tow days'
one is paid for love someone '
and one day is paid for hate him'
|
|
|
|
|
Amirjalaly wrote:
what is equal for Declare and lib in C#?
Check the documentation for DllImportAttribute Class[^].
- Nick Parker My Blog
Last time I checked, all programmers have selective ignorance. I know nothing about 3D graphics. I know a lot about COM. VB gets under people's skin because one can be ignorant of computer architecture and ASM and still get a lot done. - Don Box
|
|
|
|
|
Hello,
I'm going to use C struct in C#, but I'm not sure how to convert the struct to C# structure?
struct HeaderStruct
{
void *FileHeader;
void *Info;
char *input;
}
could anybody help me? Thank you~~
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
public struct HeaderStruct
{
public IntPtr FileHeader;
public IntPtr Info;
public string input;
}
-----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-----
|
|
|
|
|
Use a custom ListViewItem or something with the properties you want, and in the handler for the ListView.SelectedIndexChanged event, set the PropertyGrid.SelectedObject to your custum ListViewItem . You should read about the classes in the System.ComponentModel namespace for ways to provide custom TypeConverter s and UITypeEditor s for those properties if you require it.
-----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 all!
Possible do toolbar flat as in IE6.0?
I know that in VC6.0 this was not a problem.
But in VC.NET, I can not do this.
|
|
|
|
|
ToolBar.Appearance = ToolBarAppearance.Flat
-----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-----
|
|
|
|
|
Many thanks.
You me much helped.
|
|
|
|
|
Hi Guys!
we know that there is a way to handle custom exceptions in
asp dot net by specify the error page.
is there any way to do the same in csharp windows form.
i.e custom windows form.
i don't want to write try/catch block in my programm
in all places.i just want to write it once where it can handle all the program exception. is there a way.
i want to write only one try/catch block that can handle all the exceptions of the whole applications(windows Application), which off-course may contains multiple windows forms
Ali Khan
|
|
|
|
|
AppDomain.UnhandledException
You can get the current AppDomain with AppDomain.Current .
-----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've been battling this too long and wanted to see if someone can help.
I've created a directory on our Win2k Server. The directory automatically assumes I want to inherit the parents (i.e. the box under the security tab that says "Allow inheritable permissions from parent to propagate to this object"). Ok, that's fine, but I would like to turn that option off through my C# script. I can add ACE's and modify everything at the ACE level, but haven't found anything that states how to change this option.
I'm sure it is simple, but I haven't been able to figure it out.
Thanks!
|
|
|
|
|
I need a way to be able to detect when ac power to my computer is not available. My cpu is on an UPS and system power management does not catch this event if i unplug the UPS and my system runs on battery. I read the documentation for the system power management class and it will detect an ac to battery power event for a system (internal battery) battery. Does anyone know of a way i can detect when power is coming from a battery in the UPS? Thanks in advance!
|
|
|
|
|
Well, to the computer it's still just AC power. But AFAIK many UPS power supplies have some sort of serial-port or USB connection, and drivers that tell the computer when it's on UPS battery power.
I'm not an expert on this by any far stretch, though, so I can't really answer you question completely.
|
|
|
|