|
Thanx this is very helpfull
regard
Edwin46
|
|
|
|
|
you should try make a public class that returned a control u want to be call in another form
|
|
|
|
|
Can U give me an example, Please. Thanx a lot
regard
Edwin46
|
|
|
|
|
for example in form 1:
public DataGridView DataGridView1
{
get { return MyDataGridiew; }
}
and in form 2 you can call MyDataGridview
Hope it solve your problems
Regard,
TCim
|
|
|
|
|
Hi all,
I'm currently coding an enhancement to a drag & drop feature where it is now possible to invoke a second drag & drop mode. A colleague has suggested that it would be be aesthetically more pleasing if I use a different drag cursor when in the new mode. Some research has revealed that overriding the OnGiveFeedback function is the way to go; however on playing around with cursors and such I've encountered a problem for which I have not been able to locate a solution: the default cursor for a Move or Copy operation doesn't appear to be available from the places I would expect cursors to be (or perhaps I'm not looking in the right places...). Does anyone know where I can get it when I am in the gfbevent.UseDefaultCursors = false; state?
cheers!
|
|
|
|
|
Code snippet :
<br />
private void lstFilesOnDisc_GiveFeedback(object sender, GiveFeedbackEventArgs e)<br />
{<br />
e.UseDefaultCursors = false;<br />
if (e.Effect == DragDropEffects.Copy)<br />
{<br />
this.Cursor = curDragging;<br />
}<br />
else<br />
{<br />
this.Cursor = curNoDrop;<br />
}<br />
}<br />
|
|
|
|
|
Hi Eduard,
Thanks for your reply. It looks like curDragging is a custom cursor that was added to the project's resources. Is this correct?
I am trying to avoid using custom cursors if possible. It seems a little silly to me that I have to add a custom cursor for something which already comes with Windows/.NET!!
cheers!
|
|
|
|
|
Yep, in fact I use custom cursors which come from resources, however you can also use a cursor from the Cursors collection in .NET... The snippet is only meant to show you how to change the cursor while drag&dropping...
|
|
|
|
|
Thanks Eduard, but not quite what I was looking for. My question was probably a little vague...I was actually looking for the Drag-Copy icon rather then the way to change cursors.
I found the answer here: http://forums.microsoft.com/MSDN/showpost.aspx?postid=1868992&SiteID=1
cheers!
|
|
|
|
|
How can capture video from Webcam without audio? Because an error occured when I capture without audio. My project is capture preview and capture video from 2 Camera and more. Thank you.
|
|
|
|
|
Le Hoang Viet wrote: Because an error occured when I capture without audio.
What error?
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Does "System.Drawing.Image" as same as "System.Net.Mime.MediaTypeNames.Image"?
Can using System.Drawing.Image in the ClassLibrary?
If it can how to do?
|
|
|
|
|
jason_mf wrote: Does "System.Drawing.Image" as same as "System.Net.Mime.MediaTypeNames.Image"?
No. System.Drawing.Image is an abstract base class that provides functionality for the Bitmap and Metafile descended classes. System.Net.Mime.MediaTypeNames.Image specifies the type of image data in an e-mail message attachment.
/ravi
|
|
|
|
|
hello for every one
i am writing a code in c# 2005 to open the serial port and then to read the data and finaly store the data in an array
my code as follows:
private void ReadPort_Click(object sender, EventArgs e)<br />
{<br />
port.Open();<br />
textBox1.Text = Convert.ToString(port.ReadLine());<br />
}
but there is no output appears on the textbox , i tried ReadExisting , ReadByte etc... but nothing works
the second problem , when saving in the array , after i click the button of read the program stop working and the following message display (Input string was not in a correct format.)
my code :
data[i] = Convert.ToInt32(textBox1.Text);
(i) increased with timer.
thank you for your help
ahmad al-omar
|
|
|
|
|
Hope the article by mikepc Serial Communication[^] here in CP will help you.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Hello experts,
I use remoting in my application, but I can't tell if the remote object was really retrieved.
When I use the Activator.GetObject() method it does not throw any exception, and if I set a watch for my retrieved object all I see are details regarding the proxy (i.e. the watch shows the details of a System.Runtime.Remoting.Proxies.__TransparentProxy object).
And when I try to call a property inside of the remote object, I get a NullReferenceException .
I know this might not be enough information to solve the NullReferenceException problem, but how can I make sure that I realy have a reference to my remote object, and how should one go about debugging remote objects?
Thanks in advance,
Shy.
|
|
|
|
|
OK... Solved my NullReferenceException problem, and my app works as expected...
However, my question still stands...
Thanks in advance,
Shy.
|
|
|
|
|
Hi!
The proxy is created when you call Activator.GetObject() but until you actually call any method on the remote object, there's no need to establish a network connection to the server.
From my understanding, the remoting infrastructure doesn't hold the network connection open all the time and chokes whenever the remoting server goes down, but is only interested in whether the server can be reached during method calls to the remote object.
So the only way to find out whether the server is running is to actually call a method on the remote object. For one of my projects I added a simple Available property (always returning true ) to the server object so that I have a method to call without any sideeffects.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I have a combo box that I need to make first item in list blank. Here is the code that loads the combo box:
aAdaptor = new OleDbDataAdapter(aSQLQuery, aConnection);
aAdaptor.Fill(aDataSet);
cBox.DataSource = aDataSet.Tables[0];
cBox.DisplayMember = aDisplayName;
cBox.ForeColor = Color.Blue;
This code all works great, it loads the combo as I need. But I cannot figure out how to get the first item in the list to be blank.
Would appreciate any ideas here.
Thanks, Vern
Vern
|
|
|
|
|
You'll need to add an empty entry to your dataset. That's the only way I'm aware of.
|
|
|
|
|
You can insert an item in the DataSet before data binding, or insert an item in the combo box after data binding.
---
single minded; short sighted; long gone;
|
|
|
|
|
Is it possible to add a reference to a C# project only for a given solution?
Instead of a separate test project, I'd like to have the Unit tests in the same project, activated by a specific configuration (declaring NUINIT, having a different debug command line and being the only one that references nunit.framework)
|
|
|
|
|
(Erasing everything since I just re-read the question and really understood it)
I know you can easily do all of it, except referencing nunit.framework only on certain configurations. Maybe a #pragma (in C++ you could set the linker's command line from the source file).
If you find out how, I'd be interested to know.
|
|
|
|
|
As far as I know, the project references are really only needed by the Visual Studio IDE to inform the compiler what additional assemblies to compile/link against.
You should be able to add the NUnit reference to the project, add your conditional symbol, and wrap the using nunit.framework and your test code in a #if NUNIT directive. You might also want to decorate the test methods with a Conditional attribute as well.
This should give you what you are looking for. Personally, I prefer my unit tests in a separate project. If you're worried about trying to unit test internal/private methods you might want to consider using code coverage analysis to ensure that all of your code is being tested.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Hello All!
There are plenty of examples of excellent volume controls out there with slide bars and other fancy gizmos however I have a slightly different requirement for setting volume.
I mainly do programming within a certain application that uses its own internal sound engine to read .WAV files.
The problem is that wav files of over a certain quality can cause serious distortion if the "WAVE" option is set at anything over 50% in the sound control panel (Standard windows XP)
I wish to create an application in C# that simply has two buttons, one for high quality sound files that sets the Wave volume at 50% and the volume control to 100%, and one for normal quality that sets both at 100%
Could some kind soul possibly help out? I understand it is probably an incredibly simple problem to most on here but most my programming is XML variables and I have only recently begun to work with C#.
All the best,
Alex
|
|
|
|