|
hi all
can anyone recommand a good C# design patten book?
thx
koo9
|
|
|
|
|
|
how do I create a label (not the text kind, but the kind that is used via "goto") that can be referenced from a different form than the active form.
thanks,
Stephen
|
|
|
|
|
Never use goto. Bad practice. You can find a better way of doing the same thing.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
try a function
and try a dlegate to point to it in the ather form then write in this function the code u want to be excecuted after referencing
ByMindOnlyYouCanDoIt
|
|
|
|
|
I am trying to create a basic image viewer. I've looked all around the web and can't find any code to port to C# for image panning. What is the best way to implement image panning in C#? Would I have to do something like draw/remove x pixels depending on mouse movement or is there already a way to do it? Also, if you have a url with code in another language for image panning, please supply it Thanks.
|
|
|
|
|
You should be able to move the image object, not the actual pixels themselves. If that's all you want to do, then use the SetBounds function.
|
|
|
|
|
I'm a bit of a noob Can you explain how I would use SetBounds to pan images? Thanks for the reply.
|
|
|
|
|
So no one knows how to implement image panning in c#?
|
|
|
|
|
I have downloaded the Visual C# express beta edition and .Net Frame Work and installed on my system. I have also downloaded a sample peer to peer application in order to get the initial start. Unfortunately the downloaded application is not working due to unavailability of some liabraries i.e System.WinForms, System.Net, System.Xml.Serialization, System.Diagnostics , System.Configuration.
Do I miss an assembly reference? I have tried to search these liabraries but not found on my system and also tried to download it from Microsoft.com but could not found any resource.
|
|
|
|
|
note i found this error also so first
u must setup .netframework 1.1 and u must also know that some namespaces in the express have bugs an not complete but ofCourse it will be very COMPLETED in the shipping product
ByMindOnlyYouCanDoIt
|
|
|
|
|
Hey,
How can I run the C# compiler from my program? Could anyone point me to a tutorial or give me some help?
Thanks Ben
|
|
|
|
|
This link might be helpful: www.thecodeproject.com/csharp/livecodedotnet.asp[^]. The author also talks about plugs and other stuff that you might not need.
Notice: Microsoft.CSharp.Compiler.Compile
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Thanks that helped loads.
|
|
|
|
|
I'm trying to develop an application which changes wallpaper automatically at an interval of my choice.
I'm using the WinAPI.SystemParametersInfo() method. It works fine when running in a simple application but doesn't work anymore when running in a Windows service.
Does anyone know why?
Thanks
|
|
|
|
|
A service was mot a good choice for this application. It should stay as an application that runs from the users Startup folder. This is why:
The wallpaper is a user-specific settings, meaning that each user has their own preference for this setting. The setting, if changed by one user, is not applied to all other users on the machine, logged in or not.
Next, on Windows XP, you can have multiple people logged in at the same time, though you can only have one session active at a time.
Now, a windows service doesn't run in the context of the user(s) that is lgged in. In normally runs under the context of Local System. Further, the services each have their own desktop, or more specifically, no VISIBLE desktop. So, when your service is setting the wallpaper, it's actually doing on a desktop that you can't see.
Having said all that, it is possible to have a service interact with the desktop that's currently logged in/active. In the Service Control Manager (Administrative Tools), find your service and get the properties on it. Find the little check box that says "Allow interact with desktop". Now, this is no way guarantees that the SystemParametersInfo call will work. But if it does, the service will be changeing the wall paper for ANY user that logs in, regardless if they want it to or not. This is why it's best to leave it as a normal Windows Application and let it run out of the users Startup folder.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I agree with what Dave said. Webshots for example runs an instance on every user that wants to use the program.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Is there a way to change the forecolor/fontface/fontstyle of the column headers in a DataGrid? Maybe even the background color?
Thanks,
Mark Mokris
|
|
|
|
|
Hallo,
for launching my program when windows starts, i added an entry to
HKEY_LOCALE_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run in my setup-project.
This works fine, but if the program is loaded, if have to find out if this
was done by the user or by the operating system.
Is there a way to find out?
Thanks for your help,
Björn
|
|
|
|
|
|
Since there is no difference between the OS launching the app and a user launching the app, no.
When an application is launched out of the Run key, it is actually a request made by the Shell, to the Loader in the OS. When a user clicks on an icon in Explorer, the exact same thing happens. The Shell makes that same request to the Loader, on behalf of the user (or in othjer words, in the security context of the user).
So, no, there is no way to tell the difference...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
<br />
using System;<br />
using System.Runtime.InteropServices;<br />
using System.Runtime.CompilerServices;<br />
<br />
namespace DEMONS<br />
{<br />
<br />
[ComVisible(false)]<br />
public delegate void TestEventHandler();<br />
<br />
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]<br />
public interface ControlEvents<br />
{<br />
void OnBeforeStartTest();<br />
}<br />
<br />
[ <br />
ClassInterface(ClassInterfaceType.AutoDispatch),<br />
ComSourceInterfaces(typeof(ControlEvents))<br />
]<br />
public class Demo<br />
{<br />
public event TestEventHandler OnBeforeStartTest;<br />
public void TEST()<br />
{<br />
Console.WriteLine("TEST()");<br />
<br />
if (OnBeforeStartTest != null)<br />
OnBeforeStartTest();<br />
}<br />
}<br />
}<br />
VBS:
sub OnTest2()
msgbox "VBSCRIPT OnTest"
end sub
sub obj_OnBeforeStartMigration()
msgbox "VBSCRIPT OnTest"
end sub
set obj = createobject("DEMONS.Demo")
set obj.OnBeforeStartTest = GetRef("OnTest2")
obj.TEST
--------------------------------
obj.TEST works fine (if to comment upper string). But when I leave it uncommented i receive
Microsoft VBScript runtime error: Object doesn't support this property or method: 'obj.OnBeforeStartTest'
Whats wrong to my code - VBS and .NET?
|
|
|
|
|
Hi,
Is there any method to parse a string in the same way of sscanf?
Suppose you have a string with Number1= 3 Number2 =2.58874 . I can do this by hand, like finding the = sign and then use Int32.Parse() and Double.Parse() but since I have a lot of strings with a lot of different formats this does't seem to be a good way.
So is there any better way to do this?
Thanks!
Pedro
|
|
|
|
|
Pedro S Ferreira wrote:
So is there any better way to do this?
Actually, no. You can use regular expressions to ease things a bit, but you'll still need to parse it by yourself.
HTH.
Yes, even I am blogging now!
|
|
|
|
|
I am having one grid..i want to export that grid to word..after doing only two fields r coming ie serial no: and total..product name, quantity and unitcost r not coming into the word...those three r from databasee...How can i bring those three to the word...
the code looks like this...
object fileName = "C:\\Inetpub\\wwwroot\\eBilling\\jijo.doc";
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value;
object oEndOfDoc = "\\StartOfDoc";
object oCurrentCell="\\Cell" ;
Word.ApplicationClass oWordApp = new Word.ApplicationClass();
try
{
Word.Document oWordDoc = oWordApp.Documents.Open(ref fileName,ref missing,ref readOnly,ref missing, ref missing, ref missing,ref missing, ref missing, ref missing,ref missing, ref missing, ref isVisible, ref missing,ref missing,ref missing);
oWordDoc.Activate();
oWordApp.Selection.TypeParagraph();
oWordDoc.Content.Delete(ref missing,ref missing);
Word.Table oTable;
Word.Range wrdRng =oWordDoc.Bookmarks.Item(ref oEndOfDoc).Range;
oTable = oWordDoc.Tables.Add(wrdRng, DataGrid1.Items.Count, 5, ref missing, ref missing);
oTable.Range.ParagraphFormat.SpaceAfter = 6;
int i,j;
for(i=0;i
|
|
|
|