-
- Setting a value based on if condition
by Azurewrath
- 11 Replies
- Last post
by Azurewrath
- Is it possible to write this:
if (this.WindowState == FormWindowState.Normal) { Settings.Default.WindowSize = this.Size; } else { Settings.Default.WindowSize = this.RestoreBounds.Size; }
like this:
Settings.Default.WindowSize = if (this.WindowState == FormWindowState.Normal) this.Size; else this.RestoreBounds.Size;
If so, what's the cleanest way (as in i
-
- Windows Western Europe character set??
by Jessica Alba
- 3 Replies
- Last post
by Caddre
- sorry if this is a wrong folder.
I am using the Character Map tool to view fonts such as Times New Roman and Arial.
I want to know what codepage or character set is used when it displays Western Europe character set. Is it ISO8859-7 or Windows 1254
Please advice and I will reward you.
-
- How to have multiple sets of application settings?
by FredKotelet
- 6 Replies
- Last post
by Steven E Blake
- Hi,
I'm using the standard mechanism to set and retrieve application settings (using app.config, Settings.settings and Settings.Designer.cs). I can set the application settings using the Visual Studio IDE and retrieve them like this:
string title = Properties. Settings .Default.WindowTitle;
This works fine - for a single set of settings. But now I'd like to run multiple instances of my a
-
- Help refactoring a method
by NoEgo
- 10 Replies
- Last post
by James Curran
- I want to get rid of repetative code in the attached method I created (like in my If statements as you can obviously see, most is repeated but just for different product types) but not sure the best way to restrucure it: http: / / www. webfound. net/ forum_ posts/ repetative. txt
-
- C# app can't find DLL in the same directory?
by dl0haus
- 3 Replies
- Last post
by Discofunk
- I have a C# application that is using an unmanaged C++ .DLL. When I run it locally, it works fine (the development machine). I can debug it and all that stuff. When I copy the application up onto a server where it will reside, I put everything in the correct directories and whatnot. When I go to execute this particular function in this .DLL the application errors out and says it can't find the par
-
- Enum GetType
by h1
- 1 Replies
- Last post
by Houman b
- Hello,
I¡¯m experiencing a strange problem, with Enum:
I can do the following with WindowState (which is an enum):
String s = typeof(WindowState).FullName
And s ¡°System.Windows.WindowState¡±.
Now if I try Type.GetType(s), I get back a null
What¡¯s going on Is this because an Enum is a value type
Thanks
Houman
-
- Formatting Question: Format a SQL Server 2005 binary field the way the data appears in Query Analyzer.
by Corby111
- 3 Replies
- Last post
by Corby111
- If this is not the right forum for this post could someone please tell me where to post.
I have a field in SQL Server 2005 varbinary(max). The field holds zip files that are installs for my software.
I am querying to get the data,
When I read in the binary data, and then copy the text to the clipboard the data appears like shown below:
154176486564000128624811651118492
-
- ConfigurationManager not working ConfigurationSettings obsolete...
by RClayH
- 8 Replies
- Last post
by KWright
- When I use ConfigurationSettings, I get...
Warning 1 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings'
When I use ConfigurationManager I get...
Error 1 The type or namespace name 'ConfigurationManager' does not exist in the namespace 'System.Con
-
- static method - Is there any workaround?
by TrevorW
- 14 Replies
- Last post
by TrevorW
- I think most know we cannot declare a static anything in an interface. However, let's say I have this:
public sealed class MyClass {
private MyClass(string someText) { m_someModifiedText = someText; }
private readonly static m_someModifiedText;
public static MyClass Create( string someText ) { string modifiedText= ModifyText(someText); return new MyClass(someText);
-
- if File size exceed
by Watashi_me
- 11 Replies
- Last post
by Watashi_me
- Hello, In my code, i am writing binary data to a file. Is there any event to notify the file size exceed error. In other words what will happen if the file size exceeds while writing to a file. If i want to create a new file when file size exceeds should i catch the error or is there any other method. Thanks in advance. Cheers.
-
- File.Move works but can't open the file
by Koray Samsun
- 2 Replies
- Last post
by Koray Samsun
- Hi i have an application that i listen file system with file system watcher and then i am able to move any file to another folder. When i use File.Copy method it always works fine but sometimes(not everytime) after that i can not open file with the code below
FileStream fs = File .Open(path, FileMode .Open, FileAccess .Read);
fs.Close();
it gives error just as "File already in us
-
- 'Internal ' access modifier
by mshvw
- 6 Replies
- Last post
by michhes
- Hello, I read a lot of articles about the 'Internal' keyword but I still don't grasp it. Can someone tell me in normal non-computer language what the 'Internal' keyword does or even better provide some simple-as-possible example code for Visual Studio 2005 that shows it's accessible and it's non accessible behavior I donwloaded all kinds of samples but they all compile/run without error as they s
-
- Is there anything equavilant to this in c#.net??
by adorer
- 2 Replies
- Last post
by adorer
- this is a vb.net code help me to convert string to hex...
Microsoft.VisualBasic. Right ("00" & Hex(b(i)), 2)
is there any method or class or anything give me the same result of this in c#.net ...
help me please..
thanks in advance
-
- Generic Type Problem?
by Tech02
- 2 Replies
- Last post
by Pradeep C
- I typed the following code:
DirectoryEntry entry = core. DirectoryConfiguration .getUsersDirectoryEntry();
DirectorySearcher ds = new DirectorySearcher (entry, "(objectClass=user)" );
ds.SearchScope = SearchScope .OneLevel;
SearchResultCollection sr = ds.FindAll();
IEnumerator ie = sr.GetEnumerator();// compilation error occurs
The compilation
-
- Why this code is not working?
by cygnusx
- 10 Replies
- Last post
by ARK88
- This code must change the colour of a certain control in a form,but for some reason is not working properly,what can be the reason for that if (mainscreen.HasChildren) { foreach (Form childForm in mainscreen.MdiChildren) //this line is not executed { foreach (Control c in childForm.Controls) { if (c is ContextMenuStrip)
-
- Accessing COM DLL From C#
by pasa
- 3 Replies
- Last post
by RizwanSharp
- I have a COM based DLL. I need to use the Class defined in that DLL. What is the way to do that from C#
-
- base {System.SystemException}: {"The pointer for this method was null."}
by Alan Robbins
- 5 Replies
- Last post
by TilakGopi
- Greetings
In routine "B" called by routine "A"... In routine A my object looks great. In routine B the method table for my object has vanished! Every accessor/mutator returns this error.
My question is what would cause the method table to be dumped like this A native frame is not on the call stack when this happens.
Regards
-
- Application Events
by mxmissile
- 4 Replies
- Last post
by Peter Ritchie
- I am running an application that has the capability of calling an external DLL when certain events occur. The application is not written in Managed Code, basically in the app's ini file you specify the .DLL you want it to call. The app needs to call 2 methods contained in the .DLL.
My question is how would I go about writing this DLL in C#, is it even possible The docs give examples in C++, bu
-
- Events in .NET 3.0
by Johan Lombaard
- 1 Replies
- Last post
by ColinRobertson
- I created a Windows Application ( .NET 3.0 ) in VS2005. After adding a command button to a form and double-clicking to get the click event, nothing happens. It does not create the click event and go to the code.
When I view the properties screen, the events are not displayed, and right-clicking on the control also does not bring up the popup menu.
Has anyone seen this
-
- Overriding Object assignment from within the object (class)
by cs96ai
- 2 Replies
- Last post
by Peter Ritchie
- Hello all
=D
I'll start with the code snippet of a sample of what I'm trying to do:
public class MY Int
{
private Int32 _innerValue;
private string _stringValue;
public MYInt()
{
_innerValue = Int32 .MinValue;
_stringValue = string.empty ;
}
public Int32 InnerValue
{
get { return _innerValue; }
set
-
- Challenge: Extract Highlighted text from window with focus in any app on desktop!
by Kirk Evans
- 9 Replies
- Last post
by Kirk Evans
- When they first asked for this, I said it couldn't be done. Then they showed me an app that could do it.
To simplify the discussion, lets say I want to perform a "special action" when a "special" key is pressed using the text that is highlighted in whatever window has focus, regardless of what the application is.
Put another way, suppose I have Notepad running, a
-
- Why do we need Interfaces?
by Benin
- 9 Replies
- Last post
by Maor David
- Hi,
I am not able to understand the significance of the interfaces.
Interfaces exposes some behavior through methods, but classes can also expose its behavior through public methods directly, then why do we want to use the interfaces
is it just for an assurence that all the methods in the interfaces are inplemented in the class Is there any other reason like performance
I guess inter
-
- Create my own mp3 stream
by Madok
- 11 Replies
- Last post
by Madok
- Is it possible to create your own mp3 so you could theoretically create your own internet radio station
-
- What is the deference between \r, \n and \r\n ?!
by Picko
- 7 Replies
- Last post
by Picko
- Hello everybody, I am a little confused ! Can anybody tell me what is the deference between \r, \n, \r\n, Environment.NewLine and (char)13
-
- CompareTo
by Azurewrath
- 6 Replies
- Last post
by Azurewrath
- Hi all, Which of these 2 methods is a better/faster implementation: public int CompareTo ( object o ) { Box b = o as Box; if ( b != null ) { return numFaces.CompareTo ( b.numFaces ); } throw new ArgumentException ( "Object is not a Box Object" ); } public int CompareTo ( object o ) { if ( o is Box ) { Box b = ( Box ) o;