|
What is the C# equivilant of Exit Sub in VB?
17 year old with too much free time.
...cooler than the other side of the pillow.
|
|
|
|
|
the equivalent is return
example:
private void DoJob(string jobName)
{
if(jobName == "")
{
return;
}
else
{
}
}
|
|
|
|
|
Thanks!
17 years old with too much free time.
...cooler than the other side of the pillow.
|
|
|
|
|
Hi!
I need to know how to capture the video signal from a microcamera connected to the serial port and then show the video stream in the PC (i.e, in a window).
Well, i know that the question could be so hard, i will really appreciate any help on how to interpret the video signal or how to show the video stream... any idea, link, book, or whatever.
Could it be done with DirectX?
Many thanks in advance!
|
|
|
|
|
Hi,
Capture a video stream with directX[^]
A video signal from a microcamera should be the same as any other video signal. You will have to see if you microcamera encodes the video (if it does, with wich codecs can you decrypt it)
You can definitly use the link above to display your video stream.
This will certainly not solve your problem, but I hope it helps
Hugo Migneron
|
|
|
|
|
i have a user control that i wrote that has a collection as a property
when i use it in a program i can see collection property in the controls properties
i can also open the collection editor dialog however everything is disabled
how do i enable that so i can insert strings into my collection via the properties window
thanks
|
|
|
|
|
Hi, who knows how to get another computer time which is connected by LAN programmly, in C#/C++
|
|
|
|
|
|
take a look at this:
http://www.codeguru.com/vb/gen/vb_system/network/article.php/c1637/
it's on VB, but main idea is clear enough.
Robin Panther
|
|
|
|
|
is there an event for a listbox that triggers when the number of items has changed, if not any ideas on how to implement this?
IM PROUD TO BE A GMAIL;
|
|
|
|
|
Hello:
Here are two programs
1) MyDotNetControl - A windows form control displaying some UI
2) MyVBClient - A VB COM client app hosting the above control.
You'll need to build the control first and register is using regasm for Interop. Then run the VB program from the same location as the component. The VB program describes and shows the errant behavior. This was complied using VS2003.
Different behavior is seen when build using VS2003 and VS2005
1) VS2003 - When the user control loses focus, the text box and button disappear (the label does not). On double clicking they reappear but not on repaint.
2) VS2005 - When the user control loses focus, the text box disappears (the label and buttons do not). On double clicking they reappear but not on repaint.
Has anyone seen such problem? If so, how did you work around it?
Since there was no way to attach files, I had to include the source code here. I have a ZIP file containing the source code. If you can send me your email I can sent it to you. This should save you time.
Thanks a lot!
Sameer Nene
--------------------- Control in C#/.NET---------------------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace MyDotNetControl
{
///
/// Summary description for UserControl1.
///
public class UserControl1 : System.Windows.Forms.UserControl
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Panel panel1;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public UserControl1()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
// TODO: Add any initialization after the InitComponent call
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if( components != null )
components.Dispose();
}
base.Dispose( disposing );
}
#region Component Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
panel1.Controls.Add(this.label1);
panel1.Controls.Add(this.button1);
panel1.Controls.Add(this.button2);
panel1.Controls.Add(this.textBox1);
this.SuspendLayout();
//
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label1.Location = new System.Drawing.Point(104, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(152, 23);
this.label1.TabIndex = 0;
this.label1.Text = "My UserControl";
//
// button1
//
this.button1.BackColor = System.Drawing.Color.Cornsilk;
this.button1.Location = new System.Drawing.Point(48, 120);
this.button1.Name = "button1";
this.button1.TabIndex = 2;
this.button1.Text = "button1";
//
// button2
//
this.button2.BackColor = System.Drawing.Color.Cornsilk;
this.button2.Location = new System.Drawing.Point(200, 120);
this.button2.Name = "button2";
this.button2.TabIndex = 3;
this.button2.Text = "button2";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(120, 72);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 1;
this.textBox1.Text = "textBox1";
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// UserControl1
//
this.BackColor = System.Drawing.Color.CornflowerBlue;
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.label1);
this.Name = "UserControl1";
this.Size = new System.Drawing.Size(352, 200);
this.Load += new System.EventHandler(this.UserControl1_Load);
this.ResumeLayout(false);
}
#endregion
}
}
-----------------------------------------------------------------------------------
VB Client
Option Explicit
Dim myCtl As Control
Private Sub Form_Load()
Set myCtl = Controls.Add("MyDotNetControl.UserControl1", "MyApp", Form1)
myCtl.Visible = True
myCtl.Width = 4500
myCtl.Height = 3500
Label1.Caption = "When tabbed out of the user control (blue color), the control disappears. " & vbCrLf & vbCrLf & "On double clicking in the user control, it reappears." & vbCrLf & vbCrLf & "Forcing a paint by bringing another control on top doesn't work either." & vbCrLf & vbCrLf & "This problem is seen with MFC client applications as well." & vbCrLf & vbCrLf & "The interesting thing to note, however, is that the Label control shows up always."
End Sub
|
|
|
|
|
Hi folks,
I'm working on a project thats an in house file replication system. FileSystemWatcher does a nice job of providing events for file/folder changes. But there is no way to know which process initiated a file change. Is there some class in Csharp or some Win32 api that does this? I have seen programs that do such a thing (but unfortunately not open source).
Thanks
-Francis
Do I need a signature?
|
|
|
|
|
No there isn't. The FileSystemWatcher class doesn't provide you with a ProcessID that you can use to track back to a Application name.
The other applications that you've seen do this, do not use the FileSystemWatcher. They are custom written and must install a virtual device driver that sits between the applications and the File System. This driver handles ALL the File I/O functions that applications use, log what's it's been told to do, then just forwards the calls to the actual File System functions that were called. The applications have no idea this is happening.
If you want an example of what I'm talking about, see SysInternals FileMon[^]. But there is no source code for it...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am attempting to deserialize an object from XML. I have a stream setup to perform the deserialization from. My problem lies in the fact that the stream does not support the get_length function. This is because the stream does not have a length. It is similar to reading data from a TCP Connection, there is no inherent length of the data. I just want to read as much data from the stream as is needed to deserialize the object.
From everything I have read in the System.Xml.Serialization namespace everything appears to require this get_length function to be supported for deserialization. Does anybody have any Ideas.
thanks in advance,
Trevor
|
|
|
|
|
can you tell me what's wrong with this code here. there is only
one error, but I am not sure what it is. the problem is, that
the code that follows will not load a registry value into a textbox
I used a variable that was declared as "public static string" near the top
of Form1 (the first statement in the Form1 class near the top
of the page). this variable is used to tell part of the location
of registry key.("key1\\subkey1\\" + Form1.Variable + "")
I used Form1.Variable, becuase I am accessing the variable in another form
on the form's load event. However, when I use something like
("key1\\subkey1\\thisisnotavariablebutastring"), it actually works fine
without raising an exception. here is the code
<br />
public static string person1;<br />
<br />
RegistryKey key17 = Registry.CurrentUser.CreateSubKey("FamilyHome\\" + Form1.person1 + "");<br />
this.textBox1.Text = key17.GetValue("Monday").ToString();<br />
this.textBox2.Text = key17.GetVAlue("Tuesday").ToString();<br />
this.textBox7.Text = key17.GetValue("Sunday").ToString();<br />
<br />
<br />
if you need more info, or you want me to send you the full project with all<br />
the source code, let me know. I am so very grateful for your help.<br />
<br />
thanks,<br />
<br />
Stephen
|
|
|
|
|
Hi,
I have a set of values(currency codes) stored in the database which I would like to retrieve and display in a Property grid as a non-editable drop down list at runtime.
I tried reading the properties into a ArrayList and then displaying the same in the Property Grid but that did not show up the drop down list.
Can anyone suggest how to go about doing that.
Thanks in advance!
Jaydeep
|
|
|
|
|
Check out the TypeDescriptor Class[^], there is an overloaded method called GetProperties which allows you to return a PropertyDescriptorCollection of properties. You can use the SelectedObject property of the PropertyGrid to assign your object. This should get you started.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi,I need to read arabic characters from an already written file as it didnt see them at all
Eman Badr
|
|
|
|
|
hi, i need to create a webservice and i need an application to retrieve some binary files from this webservice (like updating). i would like to know how can i do for the webservice to transfer these files. is there some way to do it via ftp or http?
thanks,
|
|
|
|
|
Hi, I would like to know how to load 2 instances of "notepad.exe" (or any other exe) on each side of a split container inside my form, not to load when my application starts as an external program, but make it a part of my form so they both load inside my application when I start it.
|
|
|
|
|
what?? you can't do this unless you find a custom control and add it or you make your own.. its pretty easy to make it by yourself though..
IM PROUD TO BE A GMAIL;
|
|
|
|
|
It CAN be done, but you have some major technical hurdles to jump through. In general, it's not possible to redirect the window of an application into the window of another app. And, no, I've never done this before. I've heard of it being done and how the process is accomplished, but don't ask for example code. I don't have any.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I have a datagrid with a list of customers. I want to be able to click on the row then be able to display the customer number which is in the first column of that row.
I have code for finding the row number:
rowNumber = grdDisplayCustomers.CurrentRowIndex;
But how do find out the customer number which is in the first column of that row.
Many thanks in advance,
Steve
|
|
|
|
|
Have you tried using a hyperlink column? Not sure if this will work for you but you could have column 1 with text 'View Details' and have this as a link to another page displaying the customer info. Something like this...
private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e){
//cast to dataGrid as that is what you are using
DataGrid grid = (DataGrid)sender;
//redirect to page you display customer info in passing customer number from column 1 (column 0 is your hyperlink column)
string page = "newpage.aspx?id=" + grid.Items[grid.SelectedIndex].Cells[1].Text;
Response.Redirect(page,true);
}
Just an idea!
Colin
|
|
|
|
|
grdDisplayCustomers[grdDisplayCustomers.CurrentRowIndex,0];
|
|
|
|