newb question

1140 byte By peter449 at 2007-11-25 11:07:11
so i have to make a windows application that displays 2 texts over and over again using a button in the interface, and i think i need a loop, but not sure how this is done for text./codeusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;u...

process.start() isnt working

767 byte By KB1IBH at 2007-11-25 11:07:25
ive got a program set up so that when i run it, it will run a batch script... whenever i run the program, it seems as though the script runs fine, but anything that i put into the script doesnt get executed... ive tried having it run an exe, when i ran it through windows, it worked, but didnt throug...

Can Someone Help Me Convert 3 Lines Of C# to C++/CLI

323 byte By 2MuchRiceMakesMeSick at 2007-11-25 11:07:26
mshtml.IHTMLDocument2 HTMLDocument = (mshtml.IHTMLDocument2)axWebBrowser1.Document;mshtml.IHTMLElementCollection links = HTMLDocument.links;foreach (mshtml.HTMLAnchorElementClass el in links){}Im trying to get the links from a webbrowser controlhelp with this is greatly appreciated!...

Enum help

354 byte By Visslan at 2007-11-25 11:07:41
I have an application that has two iFrames C and W. Now I want to use enum to enable controls depending on what iFrame is running. I have been told to use enum. This is how far I have come. How do I go forward?public class Application{ public enum ClientType { C , W }; public Application() { }}...

overloading binary operator to work with ctrlInst.Location?

967 byte By w0lfshad3 at 2007-11-25 11:07:42
EDIT: solved: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2218770&SiteID=1&mode=1I looked over operator overloading examples but i still can't see how can i overload >= for instance to work with ctrlInst1.Location >= ctrlInst2.Location. Anyone has some thoughts?So far derived fr...

file watcher only runs for pasted files

1221 byte By JACKWEBS at 2007-11-25 11:07:45
The following code picks up pasted files and runs relevant events.However, when I copy a file from one location to the folder being watched, it doesn't do anything. ANy ideas? private void SetupWatcher() { // Create a new FileSystemWatcher and set its properties. //watcher.Path = @"C:\tes...

How to expose std::vector in C Sharp

1507 byte By vijaykumartiwary at 2007-11-25 11:07:55
I have created a COM server in which a collection of vectors need to be exposed to C# sharp client . Each vector contains a array of structures and this vector need to be embedded inside a container, say another vector or list. Code: typedef struct { std::string name; std::stri...

Multiple projects

971 byte By Marcel.Kummer at 2007-11-25 11:08:09
Hello folksAs I just started to discover C# Express this is probably a very basic problem :blush: :I started up a new windows application project. I would like to use the SourceGrid Control ( http://www.devage.com/Wiki/ViewArticle.aspx?name=sourcegrid&version=0) within my application. So I added the...

time since last reboot

2453 byte By forgottenhart at 2007-11-25 11:08:15
I am having to find the time since the last reboot of a machine. I am able to find the time of the last reboot using the code below. However I have seen code where they have simply querried the OS and gotten the time since last reboot. That seems a lot simpler. Can anyone point me to an example o...

how to set datagridview cell txt

402 byte By comicrage at 2007-11-25 11:08:28
I have datagridview and I need to set the cell text to either Y or N. It is databinded to a business object.grid[columnIndex, rowIndex].readonly = false;grid[columnIndex, rowIndex].value = "Y";grid[columnIndex, rowIndex].readonly = true;When the cell value is equal to "N" and it passes the code, the...

Newbie Question - Profesional Menu Strip

339 byte By nodo at 2007-11-25 11:08:32
How do I make a profesional or 3d menu strip? I am using Visual Studio 2005. I look around and try to set in property but could not find it. If I look at IE, there is at least a bevel divide line in between menu strip and menu button. Do they have this in tool box? I am attaching my project alo...

C# Equivalent of swap in C++

1122 byte By pre_wreck at 2007-11-25 11:08:41
I have here a piece of code that swap two numbers. whether its a string or and integer.I would like to ask if theres an equivalent code for c#? If yes, then how can I do that?Thank you // This method will swap any two items.// as specified by the type parameter <T>.static void Swap<T>(re...

New Bee question to C# float number

910 byte By Fugu13Young at 2007-11-25 11:09:05
Hi, i'm learn C# and currently using the Visual C# 2005 Express Edition and i have question regarding the behavior for floating point number calculation. I have the following variables:public float totalPurchase;public float totalCash;public float totalReturn;public float totalVoid;public float...

dalay returning of web service invokation

600 byte By rgalopo at 2007-11-25 11:09:06
Hi All!Im developing a multithreading C# application in which one I invoke several web service methods in the same machine. Those web services have been developed with java / Apache web server, and I cant change them. My problem occurs sometimes in Windows XP, when I invoke a web service method the...

External Program ListBox read

699 byte By sagym at 2007-11-25 11:09:15
Hello all,I'm trying to write a program which will be able to read a list box in an external program using WinAPI.I'm using sendMessage function:public static extern IntPtr SendMessage(HandleRef hWnd, uint Msg, IntPtr wParam, IntPtr lParam);and want to send the LB_GETTEXT message to the wi...

Math solution - Unidentified error

2933 byte By dahwan at 2007-11-25 11:09:16
This code is suposed to be my advanced calculator :)But an unidentified error strikes in this areaprivate string Calculate(string calc) { string Result = ""; try { string[] PlusParts; string[] MinusParts; string[] MultiParts; string[] DivParts; string[] Buff...

object reference required - DTS

3954 byte By JACKWEBS at 2007-11-25 11:09:21
I have the following code, which is supposed to run a DTS package:namespace ... etc. public class Service1 : System.ServiceProcess.ServiceBase { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; FileSystemWatcher...

whats wrong with the constructor and method

1556 byte By JACKWEBS at 2007-11-25 11:09:23
AT the top I have:namespace DTSServiceforCCApp{ public class Service1 : System.ServiceProcess.ServiceBase { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; FileSystemWatcher watcher = new FileSystemWatcher();...

Why the finally clause?

251 byte By Lurken at 2007-11-25 11:09:34
I can't see the benefit of using finally over omitting the clause altogether.<br/>I mean, the code below try{} is executed no matter what.<br/>Of course there is a reason for it, I just dont know what. Would be great if anyone could explain.

Run program automatically

388 byte By Jef Patat at 2007-11-25 11:09:37
Hi,I made this little tool that opens a database and allows the user to edit it. After this he might generate some output, depending on some options set. I would like to run this program automatically, for example from the command line. What would be the best approach here? Obviously I don'...

searching an array of classes

52 byte By joemerchant at 2007-11-25 11:09:44
posted removed - just can't find way to delete.

filewatcher doesnt work when copying across WAN

620 byte By JACKWEBS at 2007-11-25 11:09:48
I have a Windows service that scans a particular folder and whenever a file is created, it fires off a DTS process on the SQL server. This works fine when I create a file on the server directly.However, if I open up WIndows explorer on a remote machine with xx.xx.xx.xx\foldername and then copy it on...

Making independent tabs / property pages

710 byte By DeepT at 2007-11-25 11:10:12
I have this project where a user can select a bunch of objects to use and some of them need custom information. I figured I could use a tab control, and then have each object (if it needs it) add a tab page IF the user decides to use it.The only way I know how to design a tab page is to make a for...

Proper Try-Catch etiquette

663 byte By RaleTheBlade at 2007-11-25 11:10:44
I'm just wondering, and this is more of a design issue than anything, but what is generally good design and etiquette when using try-catch-finally blocks? I mean, you can do it a lot of ways, from encapsulating two lines of code in a try block and catching any error, or putting 30 lines of code...

Do C# has a control like this?

111 byte By winprock at 2007-11-25 11:11:00
Please see the attach file, is it a Tree View? ListView?or else? Maybe I have to make it myself. Right? Thanks.

Inheritence issue, this has to be possible...

1290 byte By migee at 2007-11-25 11:11:16
I feel like I should know this really easily but I cant figure out how to do it.Basically I have an entity, lets say:public class MyEntity{ public string somevar = "whatever";}and one that builds onto the functionality of it.public class MyExtendedEntity : MyEntity{ public string somevar2 =...

Button, distance between Text.Top and Top

378 byte By patrickcbrown at 2007-11-25 11:11:19
Hello Everyone Does anyone know the trick to get the distance between the top of the Button.Text and the Button.Top? I am dynamically creating some buttons and want to ensure that they appear properly, the text is not known until run time so I have to dynamically set the Width and Height of the b...

retrieving registry hive names

1041 byte By novice_andrei at 2007-11-25 11:11:30
hello, maybe you guys can help:i am trying to retrieve the registry main hive names and put them into an arraylist. it does not work. funny thing i managed to retrieve the subkeys and populate the arraylist, but i dont know how to retrieve the main hive names themselves.here's the codeMicrosoft...

What do i do when...

83 byte By dahwan at 2007-11-25 11:11:41
What the heck do i do when the stupid Debugger only tells me "error in application"

Unit Tes SecurityAction.LinkDemand

357 byte By atkin at 2007-11-25 11:11:42
Hi I am trying to write unit test for my library that has class decorated with SecurityAction.LinkDemand and the public key WHen i run the unit test i get an error that there is no appropriate constructor. Removing this attribute is fine, but wont work against the code i need to test. Using c# 1.1...

Need help with Property (get/set) for arrays

926 byte By Dylankreid at 2007-11-25 11:11:44
Hi everyone :)I'm manually porting some C++ code to C# and am trying to convert some array properties.What I'd like (although this semantically incorrect) is something like this:private double[] m_oWallLoad = new double[10];public double[] oWallLoad [int index]{ get{ return ConvertToMe...

Help with an edit boxs validation being bypassed

1144 byte By DeepT at 2007-11-25 11:11:49
I have a form with a tab control that is dynamically filled out. It is filled out when you select some objects from a listbox on the same form. When you select an item that has some special input needs, a tab is added and you can edit whatever data you need. If the object is unselected it is re...

search text in DataGridView

117 byte By vivekshah at 2007-11-25 11:12:13
Hello Friends,<br/>HOw to search a text in DataGridView Control and highlight the row.?<br/>Thnx in Advance

Source code of PDN-reader

112 byte By ok21 at 2007-11-25 11:12:31
I will be very glad if anybody can send me source code of Portable Draughts<br/>Notification (PDN) support in C#

local users and groups

285 byte By snayyagari at 2007-11-25 11:12:37
Hi:<br/>I need to obtain the fully list of users and groups in a Server, like you see on Users & Groups, in computer management of control<br/>pannel. And the user in the particular group.<br/>Any help or idea is greatly appreciated<br/>Thanks in advance<br/>Surya

SerialPort component problem..

1131 byte By asafaa at 2007-11-25 11:12:46
Hello everyone,i made a simple application that uses the SerialPort component.i set the Serial port to :Baud rate = 115200databits = 8DtrEnable= trueHandshake = noneParity = nonePortname = COM3 ( the right one )RTSEnable = trueStopBits = onewhen i connect the modem to COM3 and through the HyperTermi...

Looping a directory with subdirectories?

794 byte By khalidelmeknesi at 2007-11-25 11:12:52
I am working on a windows application in VS2005 C#. The problem is that I will read a directory for files. I have a foreach so I can loop al the files in the directory. Know I wil do the same but for the subdirectories also. So I think there must be a second foreach and place the subdir in the metho...

EXE/DLL Interactivity

1235 byte By bacchus99 at 2007-11-25 11:12:59
I'm alittle new to C# but not to OOP. My main background is C++. 2 questions regarding exe/dll interactivity in C#(both the EXE and DLL are written in C# 2.0.NET framework VS2005).1. The EXE will contain the GUI for the users. I need to DLL to be able to notified the EXE when to enable/disa...

Data Grid and Check boxes

687 byte By k_nemelka at 2007-11-25 11:13:02
Hi allI have a datagrid ('dgIons') with 2 columns.Column #1 is a textbox. Column 2 is a checkbox.I don't want the user to be able to check a checkbox unless there isa value in the textbox on the same row.I tried the following but it doesn't work: private void click_cellContent(...

get nearest control to mouse cursor

1246 byte By w0lfshad3 at 2007-11-25 11:13:21
I am trying to get the nearest control to my mouse pointer in my app but somehow i can't manage to access the right thing. Project: http://files.filefront.com/MyMoO3rar/;8725371;/fileinfo.htmlEDIT: figured out this far that it returns the index from panel1 Controls so i should divide the index...

C#: 2 Arrays & For Loop

2179 byte By justravis at 2007-11-25 11:13:30
Thanks for your time!.Net 2.0Having problems on second iteration of for loop.Output looks like this:arrImgIT[0*2] = 0 = 3 = arrImgI[4+0] = 4 = 3arrImgIT[0+1] = 1 = 0 = arrImgI[0] = 0arrImgIT[1*2] = 2 = SHOULD BE 2arrImgIT[1*2] = 2 = 1 = arrImgI[4+1] = 5 = 2arrImgIT[1+1] = 2 = 1 = arrImgI[1] = 1arrI...

[RESOLVED] Creating a Windows Service (Installation Not Working)

4185 byte By Kensino at 2007-11-25 11:13:32
I am trying to make a Windows service. It's the first time I've needed to use one. The program will be run on a server and listen to port communication with unlimited clients. The entire program is working, and all network classes work as well but I want to move the code from the server.ex...

How to have vs2005 to put the referenced dlls to a child folder.

194 byte By winprock at 2007-11-25 11:13:34
When I compile a project in vs2005, it will put the referenced dlls to the same folder with .exe file, but I want to put those dlls in a child folder like "dlls/" , how to do that . Thank you .

Spliting a String by CRLF together ?

351 byte By asafaa at 2007-11-25 11:13:42
Hi,i know how Split a string with one character :DataString.Split("\r");but how do i split a string with two characters ?DataString.Split("\r\n"); // Errori tried char[] {'\r','\n'}, but it splits the string to parts of \r and \n , but not together ( \r\n);what do i do ?...

How to erase a line?

650 byte By visharad at 2007-11-25 11:13:51
There is a picture box in a form. Some drawing objects are drawn on the picture box (e.g. lines, rectangles etc.). I can draw line using DrawLine method. But, suppose on clicking on a particular button, I need to erase a line. I know the coordinates of the line, which should be erased.How do I erase...

Who starts system clock

351 byte By patrickcbrown at 2007-11-25 11:13:54
Hello Everyone Hey, does anyone know how the System Clock is automatically started? I want to replace it, I know how to kill the existing one and put one of my own there, I would rather use the same mechanism that is currently starting the existing one if I can to start mine in the future. Thank...

Returning Instances?

1174 byte By Petras2007 at 2007-11-25 11:14:08
Hello,I'm a junior programmer and I'm still trying to learn. My question is this..I need to create a new method called GetAll which I did...using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Text;using System.Data.SqlClient;namespace ExerciseUI...

Disappearing control mistery

1151 byte By w0lfshad3 at 2007-11-25 11:14:12
EDIT2: Found the bug, it's related to the key up logic.Question is though if i use KeyPreview why don't i get the KeyDown event in main form when ckicking over my text box?I'm making controls(StarProduction controls) appear and dissapear on my starMap1.panel1 by pressing space while m...

Randomly generating a sentence generates the same sentence over and over.

15085 byte By kevinskrazyklub at 2007-11-25 11:14:14
okay i have a project that im doing and i'm generating sentences, i'm wondering why the same sentence is being generated over and over again.Can someone else compile this and see what i mean. I have a for loop that adds a randomly generated sentence object to a sentence list of 299 sentenc...

Question on MouseEventArgs

222 byte By visharad at 2007-11-25 11:14:48
The second argument of a mouse event handler is an instance of MouseEventArgs. Its members X and Y give the coordinates of the mouse cursor.<br/>I want to know if these coordinates are screen coordinates or something else?