|
does anyone have any idea how i can add my (own) components to the toolbox at installtime (via my installer)?
do i need to register them in the GAC or is it possible anyway?
and how do i actually add them via code? , is there some file that i can alter , or is it in the registry?
any ideas?
//Roger
|
|
|
|
|
|
jdunlap wrote:
ref Rectangle lpRCScroll
IIRC the Rectangle struct doesn't marshal to a Win32 RECT so you'll either have to do the marshalling yourself or create a new class which does marshal as a RECT (really easy).
Creating a new class also lets you specify null as a value.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
James T. Johnson wrote:
or create a new class which does marshal as a RECT (really easy).
I had that suspicious feeling when I was looking at the UnsafeNativeMethods namespace. Half the things there are classes.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Helo, I'm attempting to create an Add-In for Visual Studio, and I need to modify and retrieve the contents of the Autos, Watch, Locals, and This tool windows. I've seen many samples on creating tools windows, but non on how to access the existing ones? Does anyone know?
|
|
|
|
|
Hi,
I begin to develop on C#.
How can i print a message on my printer
Thanks
|
|
|
|
|
If you have msdn with your VS .Net then do a search for "Print Method" or for PrintDocument.Print
There are samples on the help page. A lot easier to look that up than for me trying to explain it all here. Hope this helps. You could also do the same search on msdn.microsoft.com.
|
|
|
|
|
J'arrive à imprimer mais avec la méthode Graphics.DrawString.
Existe-il une fonction comme en VB PRINTER.PRINT qui permettrait d'imprimer une chaine de caractere directement sur l'imprimante.
Merci
|
|
|
|
|
can someone please help me giving a datagrid an eventclick?
e.g. the column should disappear on "rightMouseButtonClick"
Thanx
|
|
|
|
|
myGrid.MouseDown+=new MouseEventHandler(myMouseDown);
...
private void myMouseDown(object sender,MouseEventargs e)
{
DataGrid.HitTestInfo hi=myGrid.HitTest(e.X,e.Y);
if(e.Button==MouseButtons.Right && hi.Type==DataGrid.HitTestType.Cell)
myGrid.TableStyles[myStyle].GridColumnStyles[hi.Column].Width=0;
}
You must have Table/Column styles defined.
Hi,
AW
|
|
|
|
|
thank you for the mouse event,but there is one question i got to ask,
what about "HitTestInfo"? is there a dll for,or do i need to write a new class?
Thanx
|
|
|
|
|
It's a standard WinForm object. If You use
using System.Windows.Forms;
it will be available
Hi,
AW
|
|
|
|
|
i use system.windows.forms
dataGrid.HitTest is available,DataGrid.HitTestInfo not.
Cristian
|
|
|
|
|
Sorry. It's invisible but works at me (on Framework 1.0 and 1.1). See help on HitTestInfo (in Index or Search, not Dynamic Help)
Hi,
AW
|
|
|
|
|
I would like to have some code in a timer control that checks the current active control and sets a string based on that
I don't know how to do this. I am trying something like this, but it doesn't work
___________________________________
// Get the type of the active control ???
Type dest=frmMain.ActiveForm.ActiveControl.GetType();
if (dest == System.Windows.Forms.TabControl)// if it is a tab control
{
if (dest.Name = "tabMainAbout") // if it is tab "Main About
{
this.setPanelMessage("This is about tab");
}
else
{
this.setPanelMessage("NOT About");
}
}
______
Could you please help?
Thanks
Leonardo
|
|
|
|
|
Try something like this:
// Get the type of the active control ???
//Type dest=frmMain.ActiveForm.ActiveControl.GetType();
Control dest = frmMain.ActiveForm.ActiveControl;
if (dest.GetType() == typeof(System.Windows.Forms.TabControl))// if it is a tab control
{
if (dest.Name = "tabMainAbout") // if it is tab "Main About
{
this.setPanelMessage("This is about tab");
}
else
{
this.setPanelMessage("NOT About");
}
}
NOTE: This is not tested...
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Or
if (dest is System.Windows.Forms.TabControl) ...
<a TITLE="See my user info" href=http:
|
|
|
|
|
Hi all,
I was looking for ID for the button on the form and tried to use GetDlgCtrlID( hwnd) but instead of button ID I got the same handler that I passed to this function - handler to button window
private void test_Click(object sender, System.EventArgs e)
{
int i = GetDlgCtrlID(button1.Handle);
}
[DllImport("User32.dll")]
public static extern int GetDlgCtrlID(IntPtr hwndCtl );
When I did the sane in VB 6.0 this API worked properly.
In VB.NET same behavior as in C#
Does anyone faced such a problem ?
Is there may be another way how to get control ID that exist on the form
Thank you very much in advance
Roman
|
|
|
|
|
Hi im new to this message board, so hello to everyone.
Here's the gist of my problem.
Im creating a bascily program, that allows me to drag and drop boxes onto a canvas area.
I have all the code for drawin the boxes, and moving the boxes.
All the boxes are stored in an arraylist, along with there positions.
The problem is, that when i have selected a box, and i am draging it, I have to clear the canvas in white, redraw all the other boxes, and redraw the selected box. This creates a very noticible flicker around all of the other boxes, as they are being cleared and redrawn after every move of the mouse.
Does anybody have any sudgestions on how i can remove this flicker?
Thanks Anand
|
|
|
|
|
you need to use "double buffering", this tcehnique relies on drawing onto a hidden area and transfer the finished image in one move. Also look at validate rectangle - you only need to redraw the parts of the image that are invalid.
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
this.SetStyle(ControlStyles.DoubleBuffer,true);
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
You should also specify AllPaintingInWmPaint and UserPaint.
The first makes it so that the PaintBackground event is called from within the Paint event instead of the windows WM_ERASEBKGND message. If you don't specify this then the PaintBackground event is fired outside of the double buffer which can have some side effects (like flicker).
The second tells the framework to use your OnPaint/Paint handler instead of letting windows do the painting.
this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint,<br />
true);
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
Hello,
I am an utter newbie with C# and DirectX. None the less, I'm determined to learn C# using Managed DirectX. I'm developing a stupid game to increase my nearly non-existant knowledge and I've hit a snag. Okay, two snags.
I create a surface for a plane image, my background, back, and front. Since this is a windowed program, I can't just use normal coordinates for drawing and have to create a rectangle at the window's location (the picturebox I'm drawing to). So I create a rectangle for my plane and background and draw them to the back surface then finally to the front surface which is displayed.
This works pretty well, except, when I move the window part-way off my monitor's screen, I get an Invalid Rectangle exception. I figure when my rectangles I'm drawing to extend off screen it throws that exception. Unfortunately, I have no idea what to do about it. I can catch the exception, but then what do I do with it? Surely windowed games don't all throw Invalid Rectangle exceptions when they're moved off the screen. There has to be something I'm doing wrong.
My next problem is totally baffling to me. I decided I wanted to use System.Drawing.Bitmap's along side with DirectX since DirectX's Surface class supports that object. In my non-DirectX program I can simply load the image with myBitmap = Bitmap(GetType(), "bitmap.png"). No worries. But in my DirectX program, using the EXACT same settings, files, and resources it says it can't find "bitmap.png" resource in that class. This is driving me up the wall. The resouce is there! It works in my other program! There is -nothing- different. In my DirectX program I have to load the file with a different constructor: myBitmap = Bitmap("c:\bitmap.png") works. But... why?! Why won't it work the other way?
Anyone out there that can help me?
Especially evil today,
EvilDingo
|
|
|
|
|
Having only a little knowledge of DirectX I can only offer somethings I remember from long ago. In unmanaged DX there was a Clipper object that you had to attach to your window to ensure you didn't draw off the window (I assume the screen as well). Maybe that will help.
Now the real reason I replied:
EvilDingo wrote:
in my DirectX program, using the EXACT same settings, files, and resources it says it can't find "bitmap.png" resource in that class.
Refer to my Embedded Resources[^] article for more indepth information but I have a couple ideas off-hand.
1) Make sure you set the Build Action on your .png to 'Embedded Resource'.
2) Rather than using GetType , use typeof(MyType) . When you later decide to derive a class from that one (maybe in another assembly or a different namespace) you'll eliminate any problems arising from GetType now returning a different Type object.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
James,
I really appreciate you repling to me because you tipped me off to my Rectangle Exception. There was no clipper associated with the back surface and that is what ended up causing all the trouble. I had been working on this problem longer than any programming problem I've had in many moons. I guess that's to be expected when learning a new language...
I read your excellent resource article and I have one question. When using embedded resources, does that actually include the image file in the executable? Or does there still need to be an external file distributed?
Since I just worked out the drawing problem, I haven't tried loading a resource yet, but to answer your question, I did have it marked as an Embedded Resource in VS.net. Is there any benefit to using it as an embedded resource as opposed to just loading the image file with the filename string constructor?
Thanks,
EvilDingo
|
|
|
|