Use the MeasureString to get the width and height of the string and then calculate the center of the control or window to position your text. Ex. The Window's Width / 2 - TheFontWidth / 2 for the X cordinate AND The Window's Height / 2 - TheFontHeight / 2 for the Y cordinate I think you can use the TextRenderer Class to to perform some more advanced drawing even in VB.NET
Snews
Posts
-
VB.NET Printing Alignment??? -
GDI and User Control relatedYes, send me an email through the message board and I will reply to that so you get my email adress.:)
-
how to refresh the grid every 5 minsYou can also set this from within the code behinde simply by calling: Response.AddHeader( "refresh", "1800" ); :)
-
iis problemThis is what you should check to se so the IIS has .NET properly installed. 1. Open IIS Service Manager. 2. Right click the Default Web site and select Properties 3. IF you have a tab called ASP.NET, click that to se what version is installed and activate the one you need to run if you have multiple alternetives. --- IF you don't have a ASP.NET tab visible or it's inactive. You need to re-install the .NET framework or simply run the aspnet_regiis.exe command found in the .NET's bin directory under \WINDOWS\Microsoft.NET\Framework\vx.xxx.xx 4. IF you have .NET properly installed and activated under the IIS, then you have to check so the website or virtual directory you are trying to access has the Application Settings enabled so it can act as a ASP.NET Application. 5. IF that dosen't help and you are using Windows Server 2003 >, you must check the security settings found under the Web Service Extensions node, Make sure the ASP.NET vxxx.xx is Allowed and that any other extension you plan to use also is enabled. Hope that will help you find/solv the problem(s)
-
connection string for OLEDB2 provider..using C#Check this to get some help with the connection string. http://www.carlprothman.net/Default.aspx?tabid=86#OLEDBManagedProvider But it sure seems odd that the error isn't raised when the Open() method is called. Must be the INSERT statement that's wrong. I don't know for sure if it's ok to write the ending ) of the data declaration without any space before VALUES( ... ) declaration. I can also recommend you to start using SqlParameter to get a safer and smoother SQL handling. Take a look here for a quick example: http://www.samspublishing.com/articles/article.asp?p=27640&seqNum=6&rl=1 Hope it helps some
-
GDI and User Control relatedThe simplest thing to do is to invalidate or refresh the form when the customize Panel is minimized/maximized. You can let the customize Panel trigger a minimized/maximized event back to the parent control or just use the 'this.Parent.Refresh()' but that's not a very neet way of handling the problem. Another way of solving the problem is to calculate the area that should be invalidated and then repaint only that small area. I hope that might give you some idé to solve the problem. :)
-
Game Programming AreaWould'nt be nice to have a Game Programming area. :rolleyes:
-
Game Programming with C#Chers everybody for ansering my questions. It has become less foggy when thinking in C#, I will explore the OpenGL Potensials and also look at Managed DirectX. :cool: Marcus Grenängen MO Software Sweden
-
Game Programming with C#Like the anser on 3... :laugh: Thats right... How does it work with the memmory processing and handling in C# then? Better and easier then in C/C++? or is it just crappy? This Managed DirectX? I will take a closer look at it, even if I never have liked DirectX :~ Tanks for your time Mr... Marcus Grenängen Lead Programmer MO Software Sweden
-
Game Programming with C#Hello everybody... Im used to program my games and stuff with C++ and WinAPI with OpenGL and/or GDI, GDI+... My questions and thoughts is as follows: 1. Game programming with C# Advantages and so on...? 2. Is it possible to implement OpenGL to C#? 3. Why should I start to program in C#? Is thear any or many Advantages? Or not...:confused: Marcus Grenängen Lead programmer at MO Software Sweden.