Hi,
I'm currently working on a simple project (for study on C#) with an
input (maskedtextbox) and a listbox. The input numbers are send in the
listbox.
When the listbox is filled with numbers it automaticly puts the
scrollbar in the listbox, thats fine but it doesn't scroll down to the
last ...
more >>
Obtaining hWnd from a form - how ?
Posted by Susan Baker at 12/14/2005 5:17:21 PM
I need to pass the handle of my window (WinForm in C#) to a C library.
The WinForm does not apear to expose this property - how may I access it ?
MTIA
...
more >>
System.Collections.Hashtable serializable to xml
Posted by Ivan at 12/14/2005 5:14:30 PM
is it possible to make a universal hashtable that would be able to serialize itself to xml format?
universal one, meaning I don't have to know about the type of keys and values in advance.
Ivan...
more >>
Form.Size when Minimized
Posted by vooose at 12/14/2005 4:37:35 PM
Consider a Form with dimension Size=(300,300) that is then minimized.
Subsequent calls to Size return (160,24).
The Form is then restored and Size returns (300,300)
Is there any property or method that returns the size of the form when
restored? (so you can obtain the "real" size of the For...
more >>
SID (Security ID)
Posted by UJ at 12/14/2005 4:09:47 PM
My network engineer has said there is a system SID that you can get that is
unique to each computer on a network. Does anybody know where this is stored
or how to get it? I looked through regedit and there are lots and lots of
SID so I don't know which one is the correct one.
What's I'm loo...
more >>
Why doesn't DataGridTableStyle work?
Posted by Brett Romero at 12/14/2005 4:03:05 PM
I can't find what exactly I'm doing wrong that the following
DataGridTableStyle is not working on my table. The result set returns
21 columns. I'm only formatting 5 via the TableStyle. I thought maybe
the problem was I had more columns being put into the DataGrid than I
was formatting. I the...
more >>
type conversion issue.
Posted by Ashish at 12/14/2005 3:30:37 PM
its on .net 2.0
I am calling a stored procedure which returns value SCOPE_INDENTITY() ,
when i try to convert the result from object to int, it throws a type
conversion error...
after some hit and trials i figured out that the returned type is
actually decimal ..,
hence
int i = (int)...
more >>
Adjust how "tabs" are displayed in a text box
Posted by Benny Raymond at 12/14/2005 3:09:38 PM
Is there any way to adjust how tabs are displayed in a text box? Right
now i'm just planning on catching the KeyPress and putting 3 spaces in
instead of a tab - seems kind of bootleg, what's a better way of doing this?
~benny...
more >>
Attribute outside Class Definition .cs file
Posted by reviswami78 NO[at]SPAM yahoo.com at 12/14/2005 3:07:38 PM
Hi :
I wanted to know if the following is possible in C# ( .NET Framework
1.x):
I want to add an attribute to a class in a separate file i.e. in a file
other than which the class itself is declared/defined.
So:
//File A.cs
///////// [TypeConverter(typeof(DateConverter))]
public class D...
more >>
Sys tray
Posted by Dalibor Savanovic at 12/14/2005 2:49:03 PM
How to put app po "sleep" in system tray (place with system clock)?
Thanks, Dalibor
...
more >>
VERY upset with VS backordered
Posted by Rene at 12/14/2005 1:38:58 PM
I have been waiting almost a month for my Visual Studio 2005 Professional to
be shipped. After calling Microsoft, I was informed that they have not
shipped any orders yet for the Professional version (in the US), even if you
ordered on or before November 7 (supposed launch date). That's 1 mont...
more >>
Validation and Undo
Posted by John Richardson at 12/14/2005 1:28:51 PM
General question about how WinForms handles undoing a change during a
control's validation, if it does at all.
After a change to a control's value, if the data is determined to be
invalid, then in the control's Validating event handler, setting e.Cancel =
true will prevent the offending contr...
more >>
Encryption for a log and Unicode Characters...? Yikes!
Posted by RobKinney1 at 12/14/2005 12:41:56 PM
Hello everyone... This may sound really stupid, but it is something I have
been working on all day and haven't found a solution yet.
If you go into Notepad and try the keystroke ALT+4, you get a nice little
diamond. Infact, you can do this all the way up to 127 showing different
characters...
more >>
Public Access To TypeSafe resources
Posted by Davo at 12/14/2005 12:26:52 PM
I wish to setup a resource that holds CONSTANT values. The resource
file is call LogCat.resx (Logger Categories) and contains Debug, Info,
Error etc...
This resource is located in a resource only assembly and uses the
custom tool SettingsSingleFileGenerator to generate a typesafe class.
The...
more >>
Dynamiclly Determine Type of Parameter and Type Cast it (code insi
Posted by Lenn at 12/14/2005 12:25:46 PM
Hello,
Here's a little background. I have a function that calls a method of another
assembly (COM Interop) dynamically through Reflection. It gets method name
and array of values and calls .InvokeMember to get results. Everything worked
fine until parameters types of Boolean and DateTime ap...
more >>
WindowState
Posted by Pohihihi at 12/14/2005 12:24:50 PM
I have tried putting the following line in almost every possible place but
it does not work.
this.WindowState = FormWindowState.Maximized;
This just do not work. How to maximize form window if this is not the right
way to do.
...
more >>
Optional parameters in a procedure.
Posted by UJ at 12/14/2005 12:00:07 PM
How do you make parameters optional in a procedure. I know I can have
multiple definitions but it would be nice if there was a way I could have
the single declaration. I thought there was a way to do that.
TIA - Jeff.
...
more >>
Simple Qs: PInvoke C++ DLL Name & Version Info to C# Application
Posted by Mark Jerde at 12/14/2005 11:54:38 AM
Hello. I don't need full details, just a recommendation from experts.
I wrote a lot of Pre-ANSI K&R C programs but I'm not a C++ expert. The
volume of C++ info available is daunting... <g>
I am working on a project where a C# GUI program uses a number of non-.NET
C++ DLLs. PInvoke is w...
more >>
Utility to make C# code look pretty
Posted by Ed Debrot at 12/14/2005 11:35:45 AM
Nothing drives me crazier than having to look at someone's code where the
indentation is sloppy. Some lines are indented 2 spaces, others 10 spaces.
Sometimes there's 10 blank lines between lines of code, others times there's
none. Sometimes there are spaces around boolean operators, sometimes ...
more >>
This is just plain stupid.
Posted by Mike Labosh at 12/14/2005 11:19:58 AM
I can say this:
int commandTimeout =
Convert.ToInt32(ConfigurationSettings.AppSettings["commandTimeout"]);
but I can't say this:
int commandTimeout =
(int)ConfigurationSettings.AppSettings["commandTimeout"];
Or maybe my VB background has caused brain damage, where I can do this:
Dim...
more >>
problem with textbox
Posted by melanieab at 12/14/2005 11:09:19 AM
Hi again,
I have a textbox where the text is longer than the textbox width. When I
type something in there or even do any single keystroke (other than tab, up,
down, or enter) and then leave, the beginning of the string shows, and focus
goes on to the next box. But if I just tab through or w...
more >>
CodeDom question for .net 2.0
Posted by Ashish at 12/14/2005 11:08:00 AM
I am using the CodeDom namespace for generating classes, and would
really like to be able to use the CodeRegionDirective class to generate
regions around code blocks.
The only problem is that is looks like i can generate regions around a
single method or a single statement (using StartDirec...
more >>
Structure as object property
Posted by JSheble at 12/14/2005 10:49:50 AM
Are there any reasons why I shouldn't or couldn't use a structure as a
property in a class? Specifically since structures are value types and
objects are reference types?
I have a Shipping object that has 4 different types of addresses.
Initially, I created 4 instances of an Address ob...
more >>
inheriting with static methods and type passing, recommendation?
Posted by MSDNAndi at 12/14/2005 10:41:07 AM
Hi,
I have a baseclass (non-static) with some static and some non-static
methods/fields/properties.
In the baseclass in one of the static methods I need to do something like
"
somelogic
....
CallToStaticMethod();
....
somelogic
"
The problem is, that I need to be able to change Cal...
more >>
xor question
Posted by Susan at 12/14/2005 10:33:37 AM
I have a stream of chars where I am trying to xor certain parts. I guess the
meat of my question is that if I xor the hex values:
476f ^ 7262
I get a different value that if I xor the integer values:
71111 ^ 114098
Does anyone know why? I'm assuming that I can't just use the hex values for
x...
more >>
Selecting all the items in a ListView
Posted by Mark Rae at 12/14/2005 10:30:04 AM
Hi,
I have a bog-standard ListView control in a v1.1 C# WinForms project, with
three colums, Details View.
There is "Select All" button under the ListView control with the following
code:
foreach(ListViewItem lvi in lvBackupFiles.Items)
{
lvi.Selected = true;
}
This r...
more >>
Problem running a scheduled service
Posted by Michael Groeger at 12/14/2005 10:10:37 AM
Hi NG,
I have written a service which should start at certain time in the morning
and stop at a certain time in the evening. For this, I added the following
to the Main() method of the service:
public void Main(string[] args)
{
// [...]
if (args.Length == 1)
{
if (ar...
more >>
Scolling text.
Posted by UJ at 12/14/2005 10:03:52 AM
I need to display data in a scrolling area much like HTML's marque (one
scrolling left and one scrolling up). Is there an object that will do that
for me in a C#/Windows app or do I need to load a browser window and then
use an HTML file to do it.
TIA - Jeff.
...
more >>
Static Form, that work like MessageBox?
Posted by Bry at 12/14/2005 10:02:49 AM
Is it possible to produce a Windows Dialog form that can be used like
MessageBox.ShowDialog(), but returns a custom object type
e.g.
myObject = MyForm.ShowDialog();
rather than
// This method doesn't return the object either and ShowDialog can't be
// overriden to make it behave like t...
more >>
How C# Regex to express "IDENTIFIER = ON/OFF"
Posted by James at 12/14/2005 9:45:48 AM
User has a input as "SwitchName = ON" or "SwitchName = OFF", how to use C#
Regex to get SwitchName and the value?
Regex.Match(line, @"(\S+) = {ON|OFF}") does not work.
...
more >>
Very odd beahvior of web application
Posted by Mike Schilling at 12/14/2005 9:28:02 AM
We have a C# application running under ASP.NET. It wasn't written using any
VS.NET magic; all of the call the System.Web are made explicitly. It uses
..NET 1.1; no other version of the framework is present on the machine.
There are two web.config files: the one at the top level specifies an ...
more >>
How to readfile in a stream array
Posted by Sebastiaan at 12/14/2005 9:14:09 AM
Hi !!
Could some one perhaps give me a bit more info on reading the data in a
stream?
We use readfile at the moment to get the data from a buffer from the port.
Would it be better to use a BinaryReader in some kind of way?
And how???
Regards,
Sebastiaan
...
more >>
C# Windows Form and client's operating system
Posted by Jason Huang at 12/14/2005 8:49:13 AM
Hi,
I am wondering in my C# Windows Form, how do I know the client PC's
operating system?
Thanks for help.
Jason
...
more >>
N-Tier Application - Question about Static Methods
Posted by dn at 12/14/2005 8:07:38 AM
I'm starting an n-tier application with an ASP.NET 2.0 presentation layer, a
business layer, a data access layer, and a SQL Server 2005 database, and I
have a question.
In the business and data access layers, should I use static methods? Or,
should I code the classes so that they have to be i...
more >>
how to start a thread with in-place function?
Posted by parsifal at 12/14/2005 7:46:47 AM
In Java I can start a thread and write the function in-place. So, you
could do, in pseudocode:
def someFunc:
thread.new( def summit: doSomeStuff() )
How can I do that in C#?
...
more >>
XmlTextWriter Probelm to create a new document
Posted by Point.Cube NO[at]SPAM gmail.com at 12/14/2005 7:45:27 AM
Here is my code, but the problem is I want to recreate a new file but
at the and I find that the program add the new element the old ones!!
****************************************
System.IO.File.Delete( mXmlFile);
System.Xml.XmlTextWriter XmlWtr = new System.Xml.XmlTextWriter(
mXmlFile, null...
more >>
How to get the "Windows" directory?
Posted by parsifal at 12/14/2005 7:15:20 AM
Hi,
I'm wondering how you can use the standard C# library to get the
"windows" directory? (e.g. "c:/windows"). I need to specify the
location of a config file in a service, and I don't want to hard-code
anything.
Thanks.
...
more >>
C# 2.0/VS2005 inheritance reference problem
Posted by MSDNAndi at 12/14/2005 6:50:02 AM
Hi,
I have the following problem with VS 2005 (Professional) and C# 2.0
I will use assembly and namespace synonymously here.
I have a class in namespace InheritClass inherit from a baseclass in
namespace BaseClass.
Then I have a class in namespace InheritClassUser that uses the class in
...
more >>
OpenFileDialog Problem
Posted by bartmanson at 12/14/2005 6:50:02 AM
Hi everybody,
this is my first post to this newsgroup.
I have a problem with OpenFileDialog. I programmed a windows form that has a
button that opens a OpenFileDialog. If a user chooses a file and presses the
OpenFileDialogs "Open" button, the chosen file will be added to a list box.
If ...
more >>
Delegate question
Posted by ^MisterJingo^ at 12/14/2005 5:01:13 AM
Hi all,
I've been trying to get my head around delegates. The book i'm using
had a single example, not much explaination, and didn't show how to set
up a delegate and pass variables in and out of the functions it refers
to. So I've been playing around and came up with he following code. I
kn...
more >>
Differences between these cast operations / statements?
Posted by toebens at 12/14/2005 3:53:02 AM
Hi,
i read this
http://msdn.microsoft.com/chats/transcripts/vstudio/05_0811_dn_csharp.aspx :
Cyrusn_MS (Expert):
Q: please explain the difference
1: Convert.ToInt32(o)
2: (int)o
3: o as int32
A: Rk: It all depends on what o's type is. Convert.ToInt32 will convert a
lot o standard framew...
more >>
DATASET SET NULL to GUID Field
Posted by mPiccoli at 12/14/2005 3:36:02 AM
how I can a Guid field on Null setting (DATASET)...
more >>
Impersonation for accessing network resources?
Posted by Ben Fidge at 12/14/2005 3:20:02 AM
Hi
I have a small WinForms app that needs to copy files from a shared drive on
a network. If I connect to the mapped drive using Explorer, a password dialog
pops-up and I have to provide credentials with permission to access this
resource on the machine where it's hosted. This is once for e...
more >>
PrintPreviewDialog trouble
Posted by jacopomeucci NO[at]SPAM libero.it at 12/14/2005 3:17:04 AM
hi all.
I've a problem with PrintPreviewDialog in c#.
I've done a form with a ListViewControl and i tried to print the data
contents in this listview.
I've read the ListViewControl via a WHILE cicle and i've done document
then i've send it to the PrintPreviewDialog...end it seems to be
...
more >>
Runtime Object creation
Posted by Tim at 12/14/2005 3:05:02 AM
When the Application is started, it has to read a config file. The config
file gives details of the objects that need to be created. Based on the info
from the config file, the objects need to be instantiated at run time and its
methods have to be invoked. How do I do this?
Is reflection t...
more >>
getstockobject
Posted by yogi at 12/14/2005 2:37:52 AM
hi all,
i m developing an application on compact framework using c# in which i
need to use getstockobject pinvoke for which i need to get the constant
values for NULL_BRUSH,HOLLOW_BRUSH used as a parameter in
getstockobject call.
[DllImport("coredll",SetLastError=true)]
public static exte...
more >>
Need a Close Watcher of Files
Posted by viper at 12/14/2005 2:26:08 AM
C# has a good class FileSystemWatcher. But how can I manage to collect
data such as
1. If the file is copied / moved / cut - pasted / dragged - copied to
other location - need to know the location also where moved
2. Emailed to others - if emailed then "by who to whom"
3. IF NEEDED I will be ...
more >>
SendKeys in ProcessCmdKey: change Shift-Space to just a Space
Posted by John Richardson at 12/14/2005 2:14:55 AM
I'm trying to override the SHIFT-SPACE "negative feature" in the Winforms
datagrid, to only be a space.
The following link describes this:
http://www.dotnet247.com/247reference/msgs/52/262224.aspx
In this procedure, MS suggested to use SendKeys.Send(" "), but I am finding
that this locks ...
more >>
Custom buttons in toolbar
Posted by mookid8000 NO[at]SPAM gmail.com at 12/14/2005 2:12:08 AM
Hello again, group!
Can someone tell me a nice way to include a zoom percentage combobox in
a toolbar?
My first try was a workaround, where I inserted a bunch of separators
where I wanted the combobox to be, and then painted the combobox on
top.
I'm just thinking, there must be a better ...
more >>
repost - Reflection and Inheritance
Posted by John Richardson at 12/14/2005 2:07:00 AM
My original posting (Dec 12, this group) is copied below, but it boils down
to a simple question first:
does an inherited class prevent certain internal properties (inherited from
an ancestor class) from being visible to GetType().GetMethod()?
And can I call GetMethod from the context of the...
more >>
How to validate the URL ?
Posted by Prakash at 12/14/2005 2:03:33 AM
Hi Friends,
I am developing application based on .net Remoting. In my client
application i have accessed the remote object by Activator.GetObject
function. In this GetObject function, i have passed the second argument
as URL, like "tcp://localhost:8384/Container". From my client program
how c...
more >>
Interop - Object Lifetime
Posted by Tim at 12/14/2005 1:57:03 AM
I have a class called Manager. In the 'Initialize' method of the Manager
class, I create an instance of a COM class (say oComObject). What is the
lifetime of oComObject. Will it be available as long as the 'Manager' object
is in memory?
Is there any difference in object lifetime with and w...
more >>
Birthday generated by ID number
Posted by Wolf at 12/14/2005 1:56:57 AM
Hi
I want to split a IDNumber to determine the date of birth.Something
like this.
DateTime dtBirth
split txtIdNumber in yy mm dd
Assume the idnumber = 8210195017089
dtBirth.NewDate(82, 10, 19)
txtBirthdate.text = dtBirth
Can anyone help me please
Thanks in Advance
...
more >>
win form state
Posted by Pohihihi at 12/14/2005 1:44:42 AM
Why FromWindowState still shows maximized even after the size is changed to
something normal? Is there a way to find the true WindowState of a form?
...
more >>
Http server - Header problem
Posted by antimon NO[at]SPAM gmail.com at 12/14/2005 1:41:56 AM
Hi,
I need to have a simple http server in one of my applications. It's
just for a little text data so i wanted to write my own.
So i have a listener on port 80 and i'm using async methods to receive
/ send data. My problem is, i found lots of sample web server
applications, all of them just ca...
more >>
Java - C# datatype problem
Posted by GeRmIc at 12/14/2005 1:15:03 AM
Hi,
I am writing a C# client to consume a Java web service. The web service
returns a vector how do i consume that in C#? I am writing a C# web
application....
more >>
Hooking Webbrowser events?
Posted by Jim at 12/14/2005 1:13:00 AM
I'd like to hook events (like when a user clicks or right-clicks on a link
in a web page) to launch a download manager or to open a new window for the
link, but I am finding it difficult to find sources on how this can be done
using VB.Net.
Have you seen any examples such as this?
I am u...
more >>
Event framework
Posted by veziak NO[at]SPAM yahoo.com at 12/14/2005 12:15:44 AM
Dear colleagues, we have encountered some problems.
there are some types of events in our system: business objects events,
events that fire on time, on some conditions, and on user input.
so we need some framework or library which includes persistent events
and scheduling
any ideas are welcome...
more >>
request.GetResponse()
Posted by Josema at 12/14/2005 12:13:01 AM
Hi to all,
I have a program that list broken links into a web site...
The program works in the majority of the times, but in some urls, i dont
know why, but the request.GetResponse (all the html of the page) that i get
using the program
is different than if i use the internet explorer......
more >>