|
Tried same code on both Vis2008 and Vis2010 Express with the same result.
|
|
|
|
|
The ListBox does not return a right click event; see the table on this MSDN page[^].
Use the best guess
|
|
|
|
|
Thanks I guess I will have to write a custom listBox from scratch.
|
|
|
|
|
I see from your posted link that a listView does have a right.mouse.button.click. I guess that's my best solution.
|
|
|
|
|
Quite possibly; it all depends on what you are trying to do.
Use the best guess
|
|
|
|
|
Perhaps the MouseDown and MouseUp events could help.
|
|
|
|
|
better use else if in second condition
if (e.Button == MouseButtons.Left)
{
MessageBox.Show("Left Button");
}
else if (e.Button == MouseButtons.Right)
{
MessageBox.Show("Right Button");
}
|
|
|
|
|
I need to read invoice info off of a PDF. The files have no images and are tabular in design.
I did some Google searches but I can't seem to find an example of actually reading a PDF.
Anyone done this? Can you provide an example or point me in the right direction?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
|
Thank you!
If it's not broken, fix it until it is
|
|
|
|
|
You're welcome
|
|
|
|
|
ITextSharp is possibly the best tool available to process pdf[^].
|
|
|
|
|
I wish to setup some of my favorites in Internet Explorer programmatically through C# from an HTML file (same as IE export file or similar). Can anyone point me to an example or write code or point me in the right direction.
Thanks in advance,
Michael
|
|
|
|
|
You can <a href="http://msdn.microsoft.com/en-us/library/ms143368.aspx">File.ReadAllText</a>[<a href="http://msdn.microsoft.com/en-us/library/ms143368.aspx" target="_blank" title="New Window">^</a>] to read in such an IE export file. There's an example on the bottom of that page. One could also <a href="http://msdn.microsoft.com/en-us/library/s2tte0y1.aspx">File.ReadAllLines</a>[<a href="http://msdn.microsoft.com/en-us/library/s2tte0y1.aspx" target="_blank" title="New Window">^</a>] , if that's easier with manipulating strings.
Lastly, (you can almost guess it), there's also a <a href="http://msdn.microsoft.com/en-us/library/system.io.file.writealltext.aspx">File.WriteAllText</a>[<a href="http://msdn.microsoft.com/en-us/library/system.io.file.writealltext.aspx" target="_blank" title="New Window">^</a>] method available. You'll find them all in the System.IO namespace[^], which you'll need to add to your "usings".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi all,
I have searched the web for articles on using Opensource API. to convert word documents to other formats but have yet to find any. I would stick with Office Interop but I cannot install it on the web server I'm currently using unless I signup for a dedicated server. Please point me to a site if you know of one, thanks in advance.
|
|
|
|
|
|
Hi
For multiple employees (one or more), I have to generate report
--Report will be same for all employees
--Each page of report viewer will contain a single report for a single employe.
For example, for 10 employees ten report will be in ten pages of a single report viewer.
I am making report with RDLC
How i will do it??
Please help me
Thanks
modified 2-Apr-13 0:14am.
|
|
|
|
|
currently am build a Dialog like Microsoft OpenDialog, and I want to implement methods like
ShowDialog(IWin32Window owner)
but I have no idea how to use (IWin32Window).
any Suggestions, or help plzz
Mhd_MAMCO
|
|
|
|
|
Every form implements the interface IWin32Window ; that way the modal dialog will be "owned" by your parent-form. As an example;
void Button1_Click(object sender, EventArgs e)
{
using (Form f = new Form())
{
f.ShowDialog(this);
}
}
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
thankx, but my dialog implement method like this
ShowDialog(IWin32Window Owner)
{
}
that exactly what i don't know
i googled it be no answer.
|
|
|
|
|
I am guessing from the name of the method that you want to open a Form as a modal dialog. If that is the case then the code would be almost identical to that already presented by Eddy.
void ShowDialog(IWin32Window owner)
{
using (Form f = new Form())
{
f.ShowDialog(owner);
}
}
If this isn't the correct answer then you will need to say what you actually want your method to do.
Alan.
|
|
|
|
|
thank you,
i solved like this:
public DialogResult ShowDialog(IWin32Window owner)
{
base.ShowDialog(owner);
}
|
|
|
|
|
The ShowDialog-method is already implemented on each form; you'd call it and pass the owner. What class are you calling it from, and why would you need to implement it anew?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Hey
I've a custom TabControl that inherites Forms.UserControl, not Forms.TabControl. This shall behave just as a normal TabControl codewice. The issue is that TabPages beeing added in the wrong order by the designer. At first it is ok, 2 pages beeing added as expected, #1 and then #2, but when I make any changes to a Page #2, the Text for example - Page #2 beeing added as #1 in designer (the order is now incorrect):
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage1);
Pages beeing added like this in my control:
protected override void OnControlAdded(ControlEventArgs e)
{
base.OnControlAdded(e);
m_Pages.Add(e.Control as TabPage);
}
And the control designer looks like this:
public class TabControlDesigner : ParentControlDesigner
{
private DesignerVerbCollection m_Verbs;
public override void InitializeNewComponent(IDictionary defaultValues)
{
base.InitializeNewComponent(defaultValues);
OnAddTabPage(this, EventArgs.Empty);
OnAddTabPage(this, EventArgs.Empty);
}
public override DesignerVerbCollection Verbs
{
get
{
return m_Verbs != null ? m_Verbs : m_Verbs = new DesignerVerbCollection(new DesignerVerb[] { new DesignerVerb("Add Tab", OnAddTabPage) });
}
}
protected void OnAddTabPage(Object sender, EventArgs e)
{
IDesignerHost Host = (IDesignerHost)GetService(typeof(IDesignerHost));
if (Host == null)
return;
TabControl Control = Component as TabControl;
if (Control == null)
return;
TabPage newPage = Host.CreateComponent(typeof(TabPage)) as TabPage;
MemberDescriptor Descriptor = TypeDescriptor.GetProperties(Control)["Controls"];
RaiseComponentChanging(Descriptor);
newPage.Text = newPage.Name;
newPage.Owner = Component as TabControl;
newPage.BackColor = Color.White;
Control.Controls.Add(newPage);
RaiseComponentChanged(Descriptor, null, null);
}
public override bool CanParent(Control c)
{
if (c is TabPage)
return !Control.Contains(c);
else
return false;
}
protected override void WndProc(ref Message m)
{
if (m.Msg == 0x201 )
{
TabControl c = Component as TabControl;
int lParam = m.LParam.ToInt32();
Point p = new Point(lParam & 0xffff, lParam >> 0x10);
for (int i = 0; i < c.Controls.Count; i++)
{
if (c.GetTabRect(i).Contains(p))
{
c.SelectedIndex = i;
return;
}
}
}
base.WndProc(ref m);
}
protected override void OnDragDrop(DragEventArgs e)
{
((IDropTarget)((TabControl)Component).SelectedPage).OnDragDrop(e);
}
protected override void OnDragEnter(DragEventArgs e)
{
((IDropTarget)((TabControl)Component).SelectedPage).OnDragEnter(e);
}
protected override void OnDragLeave(EventArgs e)
{
((IDropTarget)((TabControl)Component).SelectedPage).OnDragLeave(e);
}
protected override void OnDragOver(DragEventArgs e)
{
((IDropTarget)((TabControl)Component).SelectedPage).OnDragOver(e);
}
}
modified 31-Mar-13 16:58pm.
|
|
|
|