Quantcast
Channel: Visual C# forum
Browsing all 31927 articles
Browse latest View live

Error -- A field initializer cannot reference the non-static field, method,...

I'm trying to put together some classes for a Model/ViewModel pattern for (my first) WPF MVVM test app. But I am getting this error in the ViewModel section:Error -- A field initializer cannot...

View Article


How do i draw the line on the pictureBox from the center to the border of the...

This is the code: e.Graphics.DrawLine( new Pen(Color.Red, 2f), new Point(0, 0), new Point(pictureBox1.Size.Width/2, pictureBox1.Size.Height/2)); e.Graphics.DrawEllipse( new Pen(Color.Red, 2f), 0, 0,...

View Article


How to simulate keyboard input to another application?

I want to simulate real keyboard input to another application. Let's say: Web browser, notepad, a game! I was looking around and i'm on a wrong track, so here i go asking you to give me a clue or...

View Article

How do I set the font of a data grid view?

Ok so in my Data Grid View, I added a new column but the header is giving me a font size of 12. I want it to be 8. The thing is, my Group Box has a font size of 12 because of the title. Is there a way...

View Article

Image may be NSFW.
Clik here to view.

choose randomly which variable should get a value

Hi,I have four labels. one of them should get SongName value as a text.This happens on buttonClick, so labels should be chosen randomly.Any Ideas how to do that?P.S. I'm doing something like a songPop...

View Article


Store checked items from CheckComboBox in a string array

From the Extended WPF Toolkit, we have the CheckComboBox. in a ItemsSelectionChanged event, I wish to store those checked items in a string array, is that possible? I try below: it does not work...

View Article

Display progressbar and percentage (%) while querying a database

when querying a database, I wish to display the progressbar and its percentage (10% interval till 100%) of completion.How do I implement it? I refer to...

View Article

easy way to do this, server side table or gridview

I have a .net web application C# and want to list data items in a table or grid as they are selected from a dropdown list box, only about 6 columns and 3 or 4 rows max in this table or grid.  For...

View Article


How do i create a trail/trace effect for the moving line in the paint event ?

In the top of the form i have:PointF _pt = new PointF(0F, 0F); PointF _pt2 = new PointF(1F, 1F); PointF _pt3 = new PointF(2F, 2F); Color _lineColor = Color.FromArgb(0, 255, 0);Then in the paint...

View Article


Can a QR code be used to identify a physical object?

I'm not sure where this question should go so if it's in the wrong place I apologize.I would like to use something like a QR code or something similar within a Windows Phone application which can be...

View Article

How to make final .exe for client from visual c#?

How to make final .exe for client from visual c#?

View Article

About Using the form Deactivate Event ?

Hi everyone,I am trying to use the deactive event of a form. Please see my below example private void frmMain_Deactivate(object sender, EventArgs e) { try { ..... if (blnSaveData == false) { Result =...

View Article

troubleshooting FFT code with Mat Lab

ok I wrote my own FFT class and  I now have MatLab on my computer. I am comparing my code to mat-lab. so my test i used it this : for (int y = 0; y < 100; y++) { double temp8 = (2D * (Math.Sin(2D *...

View Article


Calling a function from a second class .cs file .

hello,I am having a file default.aspx and its code behind file default.aspx.cs and i need to write another cs file which is searchdrop.cs and in that file i am having a function with parameter as...

View Article

Find Total of DataGrid Column - WPF C#

Hi, I have a WPF DataGrid (dgvTransactionData) and I have a column that has the total item price for each item. These will always be numeric values.What I want to do is calculate the total of that...

View Article


Random SoapException: No connection could be made because the target machine...

I have client and server on same machine. Server is web service installed in IIS 7. Web.config file for web service contains entry -   <add key="serverURI"...

View Article

Direct2D & Direct3D and a data grid view.

A while ago I put together a sample in C# Windows Forms that made use of the data grid view. I'm building also with Direct2D and Direct3D for graphics and for those libraries I have samples in C++. Is...

View Article


Buying Visual Studio 2008 Professional

Hi, now when I have learned a lot, I am ready to go "live" and start selling some apps, created with VS.But I decided to stay with VS 2008 edition, which already includes Crystal Reports (which I...

View Article

Please Help: Error Message:"Object reference not set to an instance of an...

I get following error message only when I try to run .exe through third part software name "Tidal Scheduler" but, when I run it from server Tidal is pointing to it works fine: Error message: "Object...

View Article

separate string

Hello,is it possible to separate a string like this:string a = "Hello";String a can be everything, it must be a 4 character string, and i want to separate the string in 4 different strings. string b =...

View Article
Browsing all 31927 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>