|
Programm3r wrote: How can I 'hide' the context menu strip after a selection was made from the combobox within the context menu?
Just a guess - Does the combo box have a selection changed event? If so use that to close down the menu.
|
|
|
|
|
Colin Angus Mackay wrote: Does the combo box have a selection changed event?
Yes.
Colin Angus Mackay wrote: If so use that to close down the menu
Ok ... this is were I get lost. How do I do this?
Thanks for your reply
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
|
Hi all,
I've got some experience working with .NET ActiveX components, so this is not a particularly new area for me. I'm currently developing a small component which will allow one of our products to interface with Microsoft Office SharePoint Server 2007. Obviously this means that I have to develop on the sharepoint server as Microsoft don't support client-side application development for sharepoint. However, when I attempt to register my ActiveX control on the server, the registration appears to complete successfully, but the ActiveX control is definitely not registered (I've checked tstcon32.exe and also in the registry to be sure). The exact same command definitely works on my XP boxen (the command I'm using is regasm foo.dll /tlb /codebase).
Does anyone have any insights? Google searches aren't really turning up, and I think either I've got a problem my end or codeproject searches are borked at the moment, I just get timeouts when I try and search, so apologies in advance if this question has been answered elsewhere.
Thanks very much in advance,
Mike Lewis
|
|
|
|
|
Hello,
I need to check the status of an "Intel Matrix Storage" RAID 10 via C#.
The specific RAID Data:
Onboard RAID Controller
Mainboard: P5WDG2 WS Pro
Chipsatz: Intel 975X
RAID Controller: Integrated in Southbridge: ICH7R Southbridge
Is there a way to get the status of this RAID System programmatically ? Can anyone point me in the right direction ? I don't know where to start looking.
|
|
|
|
|
tghzujkiolp wrote: Can anyone point me in the right direction ?
Intel.com[^]
But seriously, you should find the answers you are looking for there. Most of Intel's stuff is well documented.
xacc.ideIronScheme a R5RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
Hi all,
Continuing the development of my 2D game for school, I encountered a new problem that is killing me.
When I draw 1 sprite on top of the other, the one on top starts flickering. I googled for a while and found that doublebuffering would solve the problem. However, setting the styles:
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true);
does not work, neither does DoubleBuffered = true, and at one point I wrote a simpel double buffering mechanism myself, which also did not solve the problem. My program works as follows:
In the constructor, a Graphics object is created using CreateGraphics(). Then, as soon as a Timer fires the Tick event, sprite positions are updated, and the Draw() method is called of the sprite, passing in the Graphics object created in the constructor. I did not override OnPaint.
Any idea's on how to fix this?
Thanks!
|
|
|
|
|
Hi,
what is the timer's interval?
if anything less than 15, you'd better read my timers article first.
Normally painting occurs in a paint handler, that's either the OnPaint method or some
delegate you add to the Paint event. If you want a timer to cause a repaint, have it
invoke the Invalidate() method of the Control/Form.
If you have many Controls of a Form, double buffering will improve but not solve things.
For gaming (and many other apps) I prefer to have the activitly going on in a Panel,
make that one double buffered, and not have any controls associated with that Panel.
The timer then only has to invalidate that Panel, so no time gets wasted in repainting
the other Controls.
FYI: you can invalidate part of a Control by using some of its overloads.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
when i built a juggling simulator I ran into similar problems. In the end i decided that rather than having separate images for each object I would create a bitmap image in my application and stick that on screen. Given that most of my image was a black background this seemed the most efficient method for me.
YMMV
Russ
|
|
|
|
|
How much of the screen are you redrawing? Only redraw portions that require an update. See this article for a bunch of the settings required.
http://www.codeproject.com/csharp/DoubleBuffering.asp?df=100&forumid=262139&exp=0&select=1394270
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I am trying to export multiple crystal reports to a single destination PDF.
I can do export a single file to a single PDF like this:
ReportDoc.Load(rptname);
ReportDoc.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
ReportDoc.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
ReportDoc.ExportOptions.DestinationOptions = ReportDiskDestination;
ReportDoc.Export();
But, I am not able to export multiple report to a single export file. It overwrites the file and the earlier report(s) are lost.
Please help!
|
|
|
|
|
Hi All,
I've set my ToolStrip's Text property [1]. However, .Net 2.0 refuses to display it. Any ideas on how to get this control to disply the text? As usual, the documentation does not mention the property is not honored, or offer a work around...
Jeff
[1] ToolStrip Properties[^]
|
|
|
|
|
Please set DisplayStyle= ImageAndText
Also you can right click on tool strip and add a label to it and then set text to that label.
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
I work on a class that handles the a tcp-connection but now i discovered a problem with my data-handling and cant solve it =/
First some Informations:
The Socket-class provides the Async-Methodes BeginReceive and EndReceive to receive the data over the socket.
When i call BeginReceive then another Methode will automatically raise.
connSocket.BeginReceive( mainBuffer_, 0, mainBuffer_.Length, SocketFlags.None, out socketError_, new AsyncCallback( receivedata ), connSocket ); In this case the methode "receivedata" will raise when data are available. In this methode "receivedata" do i fetch the data from the socket and save it a Queue, after that i start a second thread wich process the data from the queue.
private SocketError socketError;
private volatile byte[] mainBuffer;
private volatile int receivedDataSize;
private volatile Thread processingThread;
private volatile AutoResetEvent autoResetEvent;
private volatile Queue<List<byte>> receivedDataQueue;
...
private void receiveData( IAsyncResult aSyncResult ) {
try {
Socket connSocket = ( Socket ) aSyncResult.AsyncState;
receivedDataSize = connSocket.EndReceive( aSyncResult, out socketFehler_ );
if( receivedDataSize > 0 ) {
if( receivedDataSize != connSocket_.ReceiveBufferSize ) {
byte[] tmpBuffer = new byte[ receivedDataSize ];
Array.Copy( mainBuffer, tmpBuffer, receivedDataSize );
receivedDataQueue.Enqueue( new List<byte>( tmpEingangsPuffer ) );
}
else {
receivedDataQueue.Enqueue( new List<byte>( mainBuffer ) );
}
if( ( socketClosed == false ) &&
( ( processingThread == null ) || ( processingThread.IsAlive == false ) ) ) {
processingThread = new Thread( new ThreadStart( empfangsDatenVerarbeitung_ThreadMethode ) );
processingThread.IsBackground = true;
processingThread.Start();
}
autoResetEvent_.Set();
}
else {
closeConnection();
}
if( socketClosed == false ) {
Array.Clear( mainBuffer, 0, mainBuffer.Length );
connSocket.BeginReceive( mainBuffer, 0, mainBuffer.Length, SocketFlags.None, out socketFehler_, new AsyncCallback( receiveData ), connSocket );
}
}
catch( SocketException ) {
closeConnection();
}
catch( ThreadStateException ) {
closeConnection();
}
catch( ObjectDisposedException ) { } The second thread execute the following Methode
private void empfangsDatenVerarbeitung_ThreadMethode() {
while( socketClosed == false ) {
if( receivedDataQueue.Count > 0 ) {
while( receivedDataQueue.Count != 0 ) {
}
}
autoResetEvent_.WaitOne();
} -------------------------------------------------------
OK, it looks fine but the method "receiveData" wich should be raised automatically when data are available doesnt raise everytime. After a minute it starts to stuck =/...my question is now...
Is there something that i do wrong with the threading ?
|
|
|
|
|
i'm not sure, but i think that Thread.IsAlive is a bit dangerous...
msdn says about Thread.IsAlive : "true if this thread has been started and has not terminated normally or aborted otherwise false" so if an exception comes up in your dataprocessing you have a autoResetEvent that signals something and nobody listening.
-- modified at 5:01 Thursday 29th November, 2007
never mind.. Thread.IsAlive does exactliy what it should
you could put the stuff into a console application and do some Console.WriteLines to find out where it actually stops working..
|
|
|
|
|
Hello,
I wish to incorporate some assembly security attributes to my class library. So I add something like this to my class library namespace:
[assembly:System.Net.SocketPermission(SecurityAction.RequestMinimum)]
namespace olapWeb_Controls
{
So on and so forth. Yet I have many classes in my class library - all of them reference the namespace. Apparently I can add permission by simple adding the directives to just one of the classes - but I would rather I added them one central place, rather than in just one class (which might get changed by someone else than me). Adding the same permissions to every single class seems like overkill. What should my best practice be?
Many thanks,
Morten,
Denmark
|
|
|
|
|
How I can add a new created data row in data table...?
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
datatablename.Rows.Add(colone,coltow,colthree,......);
Thaer
|
|
|
|
|
Thx for reply.
Suppose I have 10 columns and I want to pass only three values then what to do.?
Also how to manage the identity column of the table....?
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
Where to pass column name and data type..?
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
DataColumn col = table.Columns.Add();
col.ColumnName = "name";
col.DataType = type;
DataRow row = datatablename.NewRow();
row["columnname"] = value;
|
|
|
|
|
|
hi all
i build activex control by using C#.Net but i wount to preview any KeyDown on any control in new control .
the new control is 2 control is the label and textbox ,
i wount to preview any key down on textbox or on label i means any way key is down on any control on my new control .
how i can have any key is down on this control
thank for any body hellp me
Thaer
|
|
|
|
|
Hello together,
is it possible to display into a DataGridViewImageColumn different pictures, for different rows?
I tried it already this way:
looping on each row, getting the DataGridViewImageCell and set the Value-Property to a
new System.Drawing.Bitmap
But it don't work
Thanks for help
|
|
|
|
|
yes you can add columns by datatype image
go to edit columns to thr datagridview and add new column by type DataGridViewImageColumn
welcom mr
Thaer
|
|
|
|