|
The term you are looking for is "Windows Image Acquisition" (WIA)
|
|
|
|
|
The reason:
I made a tooltip control that doesn't rely on dllimports at all which is pretty cool i think
and i want the control to appear below whatever button summons...I don't want to just use mouseposition and load it where the mouse clicks because that would look unprofessional i think.
The question:
How to i get the location of a control relative to its position on the screen. I was thinking of somehow determining incremently all the outermost parents that encase the button that i want the screen coords of and adding up some stuff...
Are their any cleaner methods?
|
|
|
|
|
Something like this maybe...
Point screenPt = control.Parent.PointToScreen(control.Location);
|
|
|
|
|
TY! worked perfectly :P
Here's the code i used to put it below the button
Point spot = this.button1.Parent.PointToScreen(this.button1.Location);
this.panelbar.Left = spot.X;
this.panelbar.Top = spot.Y + this.button1.Height;
|
|
|
|
|
To see what I am talking about, create a WinForm application and add a RichTextBox to the form. Compile the application and run it.
Start typing into the richtextbox. Then paste an image into it. Then continue typing on the line below or above the pasted image. The flicker is unbearable.
If someone can give me some direction on overriding the OnPaint(PaintEventArgs pe) event to be able to successfully paint both images and text, it would be helpful and very much appreciated.
I posted once before and nobody provide any solution. Is that because noone has a solution or is it because noone is willing to help.
Thank you in advance for any help.
JB
|
|
|
|
|
Hi,
i wrote a program in vc++ and it generates some data values which i am writing it into a .txt file. Now for ploting a graph for tht data I am importing this file in excel and plotting the graph. But what i want is to open an excel sheet directly from my proram while executing and write the data whenever generated into it or to open an excel file at the end of program and import all the data in the txt file into it directly.
is it possible to implement this?.. if it is, is it very hard doin by writing handler programs or so...?
any suggestions or advices r appreciated.
thanks in advance,
Suman
|
|
|
|
|
You can open excel by using the System.Diagnostics.Process.Start(myString);
where myString is the path of the exe you wish to run.
i.e. myString = @"c:\program files\microsoft office\excel.exe";
if you want to open a file with excel then something like the following code would work.
System.Diagnostics.Process.Start(myString, @"c:\myFile.xls");
Hope this helps
Kev
|
|
|
|
|
Hi Kev,
thanks for ur help but actually my program is in VC++ and i forgot to mention it and tht too i placed it in a wrong board. Anyway if u have any idea in vc++ plz lemme know.
thanks,
Pavan.
Suman
|
|
|
|
|
Try the VC++ boards mate, they should be abel to help you.
Kev
|
|
|
|
|
yep... I have posted it there also and got some useful responses. at present i am workin on their replies and links given....
anyway thanks for ur advice... and sorry for posting it over here
Suman
|
|
|
|
|
no problem, sorry i wasn't able to help more.
Good Luck solving your problem
Kev
|
|
|
|
|
Hi guys,
I am working on an interface and I want to include a 'close' item in my file menu otehr then exit. So, that when i click 'close' item the current active document closes without exiting the interface.
I defined the menu item and all tht stuff (designer code)... but i don't know how to write a routine for it.
any help is appreciated.
thanks,
Suman
|
|
|
|
|
Just call Close() method of the active mdi child
|
|
|
|
|
hi,
You can call close() method of your base form. This will close your form without giving any notification that it is closeing. But i can tell you this not a way to design application. What i mean to say is , when your click on close button or sub menu. Then we can ask whether want to close or not. That is here you need to execute some of your logic while closeing your application. To achive this what you can do is, try to override the oncloseing event of your base form.
eg.
protected override void OnClosing(CancelEventArgs e)<br />
{<br />
<br />
try<br />
{<br />
if(MessageBox.Show("This Will Close Me. Do You Want To Continue ? ","Conformation",MessageBoxButtons.YesNo,MessageBoxIcon.Information) == DialogResult.No)<br />
e.Cancel = true;<br />
else<br />
e.Cancel = false;<br />
base.OnClosing (e);<br />
<br />
}<br />
catch(Exception Ex)<br />
{<br />
MessageBox.Show("Sorry For This Inconvenience.","Information",MessageBoxButtons.OK,MessageBoxIcon.Information);<br />
<br />
}<br />
}
and one more thing suppose if you want to exit your entire application then close won't serve you. There you can call Application.Exit() to exit your entire application. Hope this will help you out.
Sreejith Nair
|
|
|
|
|
Hi Sreejith,
Here are my actual declarations look like....
// FileExit (which closes the application)
//
this.FileExit.Index = 2;
this.FileExit.Shortcut = System.Windows.Forms.Shortcut.CtrlE;
this.FileExit.Text = "Exit";
this.FileExit.Click += new System.EventHandler(this.File_Exit);
private void File_Exit(object sender, System.EventArgs e)
{
this.Close();
}
Now how should I write the code segment that u have given me, I mean which arguments should we pass to it?
thanks,
Pavan.
Suman
|
|
|
|
|
I would like to know how to use the method ArrayList::Sort to ssort an arraylist of point in order of their decreasing x cooordinates
plese contact me on gehanmustafa@hotmail.com
|
|
|
|
|
If you look at MSDN you will see that there is a overloaded version of the sort method that takes an IComparer object. See: ArrayList.Sort(IComparer)[^]
If you look at the documentation for the IComparer[^] interface you will see that you can create your own customised sorting routines.
Something like this might work *
class DescendingEastingComparer : IComparer
{
public int Compare(Point a, Point b)
{
return b.x - a.x;
}
}
Then when you call sort all you need do is:
MyArrayList.Sort(new DescendingEastingComparer());
* DISCLAIMER: I typed this directly into the browser, it is not tested and is not guaranteed to work
Do you want to know more?
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
Hi there,
I downloaded the source of
http://www.codeproject.com/netcf/Shopping.asp
If I want debug this app, a error message appears:
A project with an Output Type Class Library cannot start directly. I don't understand the solution written below. The main code runs in the frmMain.cs...
I set Output Type of "Shopping.Engine" to Windows Application, but I know that's not the right way. Can anybody help me plz to debug this app successfully ? Thx for help !
|
|
|
|
|
You should really ask these questions on the forum for the specific article. That is what they are there for.
Class Libraries are not something you can start, they only contain part of the functionality and are designed to be fitted in with something else.
Looking at the source code zip for the project there is a Shopping.GUI project that appears to contain the starting point for the application. You should use that.
Do you want to know more?
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
When using XML Documentation I have not foud a way to document the individual elements of an enum for example:
///
/// ActionType; RunRule, Action, Terminate
///
public enum ActionType {RunRule, Action, Terminate};
When I complile I get this message in my task list:
Missing XML comment for publicly visible type or member 'VRS.RulesEngine.Interfaces.ActionType.RunRule'
Missing XML comment for publicly visible type or member 'VRS.RulesEngine.Interfaces.ActionType.Action'
Missing XML comment for publicly visible type or member 'VRS.RulesEngine.Interfaces.ActionType.Terminate'
Any ideas on this????
Gary Paul
|
|
|
|
|
|
Well that's easy, once again I was looking for a more difficult solution!!!
Thanks for the help.
Gary
|
|
|
|
|
There is a property of the Windows Forms DataGrid called RowHeadersVisible. I set it to false, but the row headers never seem to disappear. Has anyone had any success getting row headers to disappear?
Thanks!
Mark
|
|
|
|
|
If you have used custom table and column styles, then you need to turn that property off on the DataGridTableStyle object.
|
|
|
|
|
Thanks Brian! That is exactly what it was.
Mark
|
|
|
|