this code will set the position of mouse pointer. but i want to retrieve the position.
vatzcar
Posts
-
mouse pointer position -
mouse pointer positionhow can i determine the axis of mouse pointer from any method?
-
handling control array in runtimei'm trying to implement control array in my app. the no of control will depend on user's requirement. total number will be gathered from database. therefore i had to make the code within a method.
private void CreatePictureBoxes() { .... .... PictureBox[] pcbMem = new PictureBox[intCount]; Label[] lblMem = new Label[intCount]; .... }
since i'm doing the whole code in a method i can't access those controls outside of that method. it's also not possible for me to create them in class level as the total index is unkown to me initially. i don't know how to reasign the length of an array so it's being a problem for me. so please help me out to creating the controls so that i can use them from anywhere. -
popup menuhow can i popup a menu on some given coordinate? Thanks.
-
Dynamically loadning Menu ItemsI'm glad that somehow i could help you :-O I think it's optimized. And don't thank me, it's the Dev community who deserve 'cause this is what they tought me through the time :)
-
Dynamically loadning Menu ItemsI didn't understand your requirement fully, but assuming that you're trying to load menu,froms and assmblies dynamically (all are unknown to you), can be be done this way:
// assuming you load-up the assembly dynamically depending upon the menu press // i've used mod name 'cause i called the main form of the desired assembly directly and as my assembly is a dll so don't have an entry point exactly so i needed to make one entry point(virtually) public void invokeProcess (string assemblyName, string strModName) { Assembly assembly = Assembly.LoadFrom (assemblyName); // Walk through each type in the assembly foreach (Type type in assembly.GetTypes ()) { // Pick up a class if (type.IsClass == true) { // if it's not using right class skip it if (type.FullName != strModName + "." + strModClass) { continue; } // create an instance of the object object ibaseObject = Activator.CreateInstance (type); // this has been done 'cause i couldn't pass the ref. of main MDI directly frmDummy frmParent = new frmDummy(); frmParent.MdiParent = this; // Create the parameter list ('course without it we won't be able to determine our MDI parent) object[] arguments = new object [] {frmParent}; // Dynamically Invoke the Object foreach (MemberInfo mi in type.GetMember(strModEntry)) { type.InvokeMember (mi.Name.ToString(), BindingFlags.Default | BindingFlags.InvokeMethod, null, ibaseObject, arguments); } } } }
hope this will help. -
How to print directly to parallel portHello, I want to print directly to parallel port for fast writing (of-course when i use DMPs). I did following code but it generates an exception telling that it can't handle any device:
TextWriter sw = new StreamWriter("LPT1"); sw.WriteLine("This is a test print!"); sw.Close();
Currently I have working version of it(VB6)Open "LPT1" For Output As #1 Print #1, "Bla,bla,bla...." Close #1
and C++FILE *ptr = fopen("LPT1","w"); fprintf(ptr,"Bla,bla,bla......"); fclose(ptr);
How can I do that? Thanks in advance. -
Windows Form iconlook for icon property in your form's property window (generally located in right hand side pane of your IDE).
-
dynamic function callthanks for your reply :) i've fixed the problem with the help of reflection :)
-
reflexonthank you for your reply.
BindingFlags.InvokeMethod
works fine. i didn't make my method 'static', that's why i was having exception. Sorry, my mistake :( -
reflexonthank you for your reply.
BindingFlags.InvokeMethod
works fine. i didn't make my method 'ststic', that's why i was having exception. Sorry, my mistake :( -
reflexonthe member "test_mdi_Init" is a public method. also if use 'BindingFlags.Public' it throws an exception "Attemp to access a missing member". so what do you suggest?
-
reflexonhi, i'm having error "Member not found." from the following code(in time of invoking member)..
foreach (MemberInfo mi in type.GetMember("test_mdi_Init")) { type.InvokeMember (mi.Name.ToString(), BindingFlags.Default | BindingFlags.InvokeMethod, null, ibaseObject, arguments); }
what could be the problem? thanx for help :) -
dynamic function calli did, and finally nothing happens, not even any exception.
-
dynamic function callGuffa wrote:
It's possible to do that using reflection, but I doubt that you really need that. Why don't you explain what you are trying to accomplish, instead of asking how to do it the way that you think it's done?
well.. i'm trying to do is, i have one xml file which maintains which modules user has choosen to use. then my app. will load those module detail in menu(this far i've completed). when user clicks one menu that particular module's entry function will be called. now menu click event passing me the 'SENDER', from which i can extract the menu name which i've to use as identifier(nothing else i've got better than this after having many suggestion from people). after clicking the menu i'll run the entry function of that particular module. the important thing is, one user may have choosen completely different modules than other.
-
dynamic function calli want to call a function dynamically which will differ according to my need. thing i need something like this:
private void FUNCTION_NAME(string ANY_STRING) { string ANOTHER_STRING="func"+ANY_STRING; ANOTHER_STRING.ANY_STRING(); }
i'll get ANY_STRING from some other source and that's the name which will refer the class name and part of function name too. any help will be great :) -- modified at 11:50 Friday 17th March, 2006 -
using reference in runtimeVikram A Punathambekar wrote:
Does that answer your question?
Yes. and thanx a lot for the help :-D
-
using reference in runtimehow can i use a assembly(dll) reference in runtime?
-
MDI formthanx for ur help :) i did this way
Form3 frmF3 = new Form3(); frmF3.MdiParent = this.MdiParent; frmF3.Show();
it worked. thanx again. -
MDI formi have two form: Form1, Form2 and Form3. Form1 is MDI Parent form. i'v made Form2 to open when one menu is clicked from Form1. Now Form2 has one button which should show Form3, and i'v done the code this way:
Form3 frmF3 = new Form3(); Form1 fm1 = new Form1(); frmF3.MdiParent = fm1; frmF3.Show();
but clicking the button is performing nothing. how can i do that?