|
well thank for the help no doubt ill have some more
|
|
|
|
|
I got a DataGrid and I want to set a string for the cell(rowNumber, colNumber) but i do not known how to do it.
Help me please.
Thanks a lots.
Mr Duc Linh Nguyen
|
|
|
|
|
See the DataGrid.CurrentCell property documentation in the .NET Framework SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi, I have tried to integrate Microsoft.DirectX.dll into my
project, but when i'm running:
regsvr32 Microsoft.DirectX.dll , I'm getting error message:
"File was loaded dut DllRegisterServer entry point was not found. Registration failed." I thougth if I had regsvr32.exe file then I had DllRegisterServer. Can anyone tell me what is going on and what to do?
Thanks
|
|
|
|
|
I do not understand why did you do this ?
I do not understand what is your prupose?
if you want to use the dll.you can referance it
in any folder.you can put the dll in the folder.
referance it.ok?
it is my addvice.
|
|
|
|
|
regsvr32.exe is a utility used to register COM objects on your computer. A COM object lives in a DLL that exports a couple of pre-defined functions, such as DllRegisterServer.
If you want to install a COM (or ActiveX, which is the same) DLL on your computer, you may use regsvr32.exe to do that.
If you have a simple DLL, however, which does not contain any COM objects, you do not need to run regsvr32.exe; in such a case, you can simply call the functions exported from that DLL, maybe by using the DllImport attribute (if you want to do it with C# or VB.NET).
|
|
|
|
|
Andy is right, but I wanted to add that regsvr32.exe will never work on .NET assemblies. IF you have to register a .NET assembly (only when it contains CCWs, or COM-Callable Wrappers), you must use regasm.exe instead.
Note: you do not need to register the Managed DirectX assemblies. They are written from the ground-up and make little to no use of the DirectX APIs or COM servers and do not expose any CCWs that require the assembly to be registered. Besides, the Managed DirectX installer takes care of everything or simply fails if it can't perform a required action. You do not need to do anything else besides install the Managed DirectX runtime on the target machine that will run your application.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How to customize PrintPreviewDialog, such that, addition of a new button, change the functionality of existing button should be possible programatically. Sample code will help a lot.
Moreover, what happens before the document gets displayed in PrintPreviewDialog, i.e. whether entire document gets copied in printer driver spool or only 1 or 2 pages?
please guide
regards
sachin
|
|
|
|
|
In order to custom the PrintPreviewDialog , you have to use reflection to get at the controls you want to reposition. It would most likely be easier (and beneficial) to instead write your own dialog that uses the PrintPreviewControl (which PrintPreviewDialog uses as well) and customize it however you like.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
could you please guide where can I get the internal information of PrintPreviewDialog, such that I can add some controls and override existing methods.
|
|
|
|
|
Use the IL Disassembler (ildasm.exe) from the Platform SDK, or a decent decompiler like .NET Reflector[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello,
I have developed an application in C#, I used RichTextBox control for my word processing part. Now I want to add two more functions that are Print Preview and Print but I had not found any built-in method regarding Print issue with RTB. I am thinking about writing code for the event PrintDocument.PrintPage, hmmm. However, it seems not to be a good idea, I know that I would not have to do that if I deal with the problem using MFC. Though... Buddies suggest me what to do pls.
Thanks a lot.
J. Alpha
|
|
|
|
|
If you're talking about using MFC, then I assume you have some version of the visual studios. There are a couple of methods you can use for printing. The first is by using the PrintDocument, PrintDialog, PrintPreviewDialog, and PrintPreviewControls. If you're used to MFC, then you'll think these controls are wonderful...I thought they were much easier to use than the printing functions that MFC provides. The second method is by using the Crystal Reports. If you've never used it before, it'll probably take you a couple of hours to get the hang of it, but once you do, you'll be able to set up your print/print preview in a matter of minutes from now on. I recommend the second. Good luck!
|
|
|
|
|
|
I'm having a problem with the Convert.ToSingle and the O:C formatting rounding off my floating-point numbers.
When I .ToString a float, it rounds the number. It also rounds it if I use the "C" or "F" format strings (i.e. num.ToString("C"))
How can I accurately display a float/currency value w/o it being rounded off?
Thanks!
-v
****************************
V. Jenks
www.scientifik.com
|
|
|
|
|
Get an instance of the NumberFormatInfo and set the CurrencyDecimalDigits property to something higher than 2 (for example). When you use any of the string formatting methods (like Double.ToString ), pass this instance as the IFormatProvider argument.
See the NumberFormatInfo.CurrencyDecimalDigits property documentation in the .NET Framework SDK for more information and an example.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I would like to do some processes once I started the Thread, and I need to get back an ArryList that contains some file paths.
Is it possible to declare the Thread function with parameters passed in?
like :
<br />
public void Starting()<br />
{<br />
ArrayList names = new ArrayList();<br />
.....<br />
outThread = new Thread(new ThreadStart( ThreadProc(ref names, docName) ));<br />
outThread.IsBackground = true;<br />
outThread.Start(); <br />
<br />
while(outThread != null)<br />
{<br />
Application.DoEvents();<br />
}<br />
<br />
(going to do other process by using the "names") <br />
.....<br />
}<br />
<br />
<br />
<br />
public void ThreadProc(ArrayList names, string docName)<br />
{ <br />
(processing ....)<br />
<br />
if(this.outThread != null)<br />
{<br />
outThread.Interrupt();<br />
outThread = null;<br />
}<br />
}<br />
Could someone give me some hints ?
Thanks a lot
|
|
|
|
|
Take a look at: GotDotNet User Sample: Delegate Adapter: run any delegate as a ThreadStart/WaitCallback/TimerCallback
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=ca8659e8-f9ba-49ce-82e7-985836cc86e5
Quoting from the description "This is primarily good for calling a method that takes parameters and has a return value from a Thread without having to create your own object to contain the parameters and value."
I've tried it and it works
|
|
|
|
|
There's many ways to do this: asynchronous methods as the previous post mentioned, the <cdoe>ThreadPool.QueueUserWorkItem (which takes an object state variable, which could be anything from a single integer to a dictionary of properties), or creating a new class that holds the information and that contains the definition for the method to thread, like this simple example:
public class ThreadExample
{
private string s;
public ThreadExample(string s)
{
this.s = s;
}
public void Start()
{
Console.WriteLine(s);
}
static void Main()
{
ThreadExample te = new ThreadExample("Hello, world!");
new Thread(new ThreadStart(te.Start)).Start();
}
}
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am running in circles trying to find information on getting a form to span across mult monitor... I have gotten as far as SystemInformation.VirtualScreen but no explanation on how to do it. The Microsoft site's example is just obtain the resolutions. I'm sure i'm missing the obvious or just don't know the right keywords to search... been looking for two days now for some example. Any suggestions or direction to start looking. Thanks to all.
sometimes we are not all here, because we're not all there
|
|
|
|
|
Just set your Form 's Size to SystemInformation.VirtualScreen .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello,
I have a tab control on my main form and my form has an image as its background.
Is there any way for me to have the tabpages be transparent so that you can see the forms background image behind it? It works with my buttons but not with the tabpages.
I tried:
BackColor = Color.Transparent; but that didnt do anything.
If anyone can help me out that would be great
Thanx,
-Flack
|
|
|
|
|
The .NET TabControl is actually a wrapper of the "PropertySheet" control that first appeared in the Common Control Library Version 4.71. It is not a "Windowless" control that you can just make transparent by setting some flag. What you can do is to trick the user's eye into thinking that the TabPage is transparent by drawing the portion of the Form's background image underneath the TabPage. This will make the TabPage --not the TabControl-- seem like it has a transparent background.
Out of my own curiosity I just spent a mere 5 minutes putting together a sample that does this.
Here is the code I used on the Paint handler for one of the TabPages:
private void tabPage2_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Image backImage = BackgroundImage;
TabPage tp = (TabPage)sender;
if ( backImage != null )
{
Graphics g = e.Graphics;
Rectangle tabPageBounds = tp.Bounds;
Rectangle screenTabPageBounds = tp.RectangleToScreen(tabPageBounds);
Rectangle finalRect = RectangleToClient(screenTabPageBounds);
g.DrawImage(backImage, new Rectangle(0, 0, tp.Width, tp.Height),
finalRect.Left, finalRect.Top, finalRect.Width, finalRect.Height, GraphicsUnit.Pixel);
}
}
This probably could be improved but it is something just off the top of my head.
Here is a picture of what the result looks like --not perfect but perhaps close to what you are looking for--.
Transparent TabPage
Regards,
Carlos H. Perez.
|
|
|
|
|
Thanx for the help Carlos.
I have another question now.
If my tabpage had a scroll bar, and I still wanted a transparent effect, is my only option to redraw the image each time the user scrolls?
That is what I just tried and it seems like a lot of calls to redraw the image.
Is there any other, more efficent way?
Again, thanx for the help,
-Flack
|
|
|
|
|
I'd like to switch my program's data from an XML file to a SQLite database, mostly just to mess around with it.
Does anyone have any experience with this? I couldn't find any articles on it here so I'm looking for some kind of helpful article.
|
|
|
|