3
votes
1answer
107 views

How To Pass Different Objects to same Function in C#

I have 10 different classes, but below are two for the purpose of this question : public class Car { public int CarId {get;set;} public string Name {get;set;} } public class Lorry { ...
0
votes
1answer
44 views

How to return out of a function or event in VB 6

In C# if you wanted to return out of a function you could do: If (Something == True) { //Message Box Return; } Else { // Do nothing } How would one do this is VB 6?
0
votes
1answer
29 views

How can I move this function into a Class

public string F03_veri_textbox(string veriadi3) { string Veritext; Veritext = webBrowser_sample.Document.GetElementById(veriadi3).GetAttribute("value"); return ...
0
votes
4answers
56 views

Call a method on Page Load

I want to make this code work on c# code behind. I know in C something similar can be done, but can it be done here? protected void Page_Load(object sender, EventArgs e) { Bar.Text = "Updating ...
1
vote
2answers
34 views

using delegates in an array initialization

I'm coding a server and I've set up a TCP connection with all the clients. Now, when a Client sends a packet I check the opcode of the packet so I can process it. At the moment, I have an ...
2
votes
1answer
63 views

Abort a running function on button click

I have a web page which has a feature where when we click on pdf, it fetches the values of printers on the go. It takes some time, so on repeated clicks, the webpage crashes. Is there any way where ...
0
votes
4answers
52 views

Datareader, not all paths returns a value

I want to make a function which returns a string: public string LienBaseDeConnaissance(string entreprise) { SqlConnection cnx = new SqlConnection("/* connection string */"); cnx.Open(); ...
0
votes
2answers
50 views

Cannot use local variable before it is declared

I am trying to create a function but I'm getting an error message. public int[] genericSearch(int searchWidth, int startingRadius, int width, int height, Bitmap bitmap) { //Generic function for ...
3
votes
3answers
69 views

How to retrieve input from a function

I have the next code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Maman15cs { public class ClassRoom { ...
2
votes
4answers
56 views

Simple function call in C# GUI

I'm new to C#. I have two textboxes in a form and a button. When I click the button, I want the value 1 to be put into textbox1 and then the squareroot calculated and put into textbox2. I then want ...
-1
votes
1answer
17 views

Use function keys in application (MediaPlayPause, MediaNextTrack…) [closed]

I want use global function keys in my windows form application ... RegisterHotKey(this.Handle, 4540, Keys.MediaPlayPause, ?); ... Error: "Ни одна из перегрузок метода "RegisterHotKey" не принимает ...
0
votes
1answer
36 views

cut a string from right side to maximal 25 chars even when string is less than 25 chars, remove newlines of all kinds

In C# windows forms application I have strings of different length and format from which I would like to display a preview of the first 25 characters without containing any line breaks of any kind in ...
-1
votes
4answers
72 views

Updating Status Label C#

I have a WinForm C# application, and I am generating a pdf file programmatically and sending it by Email. I am trying to display a status label that shows the status (Generating File, Sending, Sent ...
0
votes
0answers
38 views

Concat return values from different methods in same class to one value in another method

is it possible to concat different return values from different methods in the same class to one method? What I am trying to do is I want to take all the return values from all the methods/functions ...
1
vote
1answer
38 views

Keep common functions in separate cs file? (C#)

I have a common functions AppPath() that is used in several windows forms of my application, instead of declaring it in each form, I would like to place it in a separate cs file. I have created a ...

1 2 3 4 5 33
15 30 50 per page