|
Hi,
Not sure, but not really surprised either:
maybe the signed DLL ends up in the GAC, whereas the unsigned one is near your EXE, and one
of them is missing a method. When the EXE knows it looks for an unsigned one it checks its folder
first, and when you rebuild based on a signed DLL I guess it looks in the GAC (first).
Hope this helps.
|
|
|
|
|
Good thought, but all assemblies are local. I used xcopy to deploy them to the test machine which is a VM so I'm certain (99% at least) that the assemblies aren't on the machine to begin with.
only two letters away from being an asset
|
|
|
|
|
I am developing a software that needs to know when the PASTE EVENT (through the context menu or ctrl+V) happens (only for files / directories). More or less, something like it happens with TeraCopy or Copy Handler. When you copy and then paste, it is TeraCopy thats handles the pastings.
I know more or less how to capture the COPY EVENT, you only have to set a ClipboardViewer and you catch all global COPY EVENTS (in fact is called: WM_DRAWCLIPBOARD). You can learn this here: http://www.radsoftware.com.au/articles/clipboardmonitor.aspx But the ClipBoardViewer does not provide you with the ability to catch the PASTE EVENT.
This software must not only work for ctrl+v, but also when you click on the option of paste in the context menu (right click).
|
|
|
|
|
Are you looking for WM_PASTE ?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I think WM_PASTE does not occur when you copy a file or directory. So I think this is not the solution.
I know I need a hook and perhaps written in C++ but I don't know how to do it.
Perhaps using EasyHook or madcodehook libraries, but this is
difficult for me, I would need some help.
|
|
|
|
|
I think for this you'll need to have a look at shell32.dll, probably SHChangeNotify[^] and on MSDN[^]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Could you supply any code? I am really clumsy with hooks.
|
|
|
|
|
Hi All,
I am writing a web browser application using Visual Studio 08 Express Edition C#. Windows Forms Application... But, one of the hardest problems is that I have founf almost ZERO support for the tabControl. And yes, I've checked MSDN. I need to let the user open new tabs, and have a new web browser control placed inside that newely created tab.
Then I want the user to be able to use the navigation buttons (back forward etc) for each of the web browser controls within the tabs. But, I cannot do this, I also want to be able to use any web browser command for every tab there is. I have tested every code sample i've found and nothing works. Can somebody please help me? Any advice/samp code/tutorials etc would be GREATTLY APPRECIATED!
thanks,
jt.
|
|
|
|
|
Hello there,
I don't know what you tried before, maybe if you post your codes here we can help you better.
I think this will help you.
Assume you have a menuStrip and have an Open command which should opens a text file into RTB (Each Tab has a RTB).
void mnuOpen_Click (object sender, EventArgs e)
{
TabPage tp = tabControl.SelectedTab;
tp.Controls["RTB"].Text = strng.Format("Open clicked in tab no.{0}", (tabControl.SelectedIndex + 1).ToString());
}
Hope Helps
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
Thank you so much for your quick reply!
Following, is the code for my Web Browser. It simple creates a new Tab, adds a page and a new WebBrowser in it:
TabPage page = new TabPage("Tab");
tabControl1.TabPages.Add(page);
WebBrowser wb = new WebBrowser();
wb.Dock = DockStyle.Fill;
page.Controls.Add(wb);
I'm having trouble accessing each individual web browser control. I want to be able to also display the name of the website on the actual tab. Can't seem to do that though... I just got your email and am about to test your code Which I'm looking forward to...
Thanks,
jt.
|
|
|
|
|
Okay, I couldn't get the code to work. It compiles. But just doesn't work at runtime, nor does it bring up any errors. Weird. Thanks your your help though, I appreciate it.
Here's my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace JT_Explorer
{
public partial class Form1 : Form
{
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HTCAPTION = 0x2;
[DllImport("User32.dll")]
public static extern bool ReleaseCapture();
[DllImport("User32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
public Form1()
{
InitializeComponent();
}
private void Stop_Click(object sender, EventArgs e)
{
Status.Text = ("Operation aborted.");
}
private void AddressBar_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
TabPage page = new TabPage("Tab");
tabControl1.TabPages.Add(page);
WebBrowser wb = new WebBrowser();
wb.Dock = DockStyle.Fill;
page.Controls.Add(wb);
wb.Navigate(AddressBar.Text);
}
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.Close();
this.Dispose();
Environment.Exit(-1);
}
private void Like_MouseEnter(object sender, EventArgs e)
{
LikedList.Visible = true;
LikedList.BringToFront();
}
private void LikedList_MouseLeave(object sender, EventArgs e)
{
LikedList.Visible = false;
}
private void Tags_Click(object sender, EventArgs e)
{
MessageBox.Show("Disabled.");
}
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.Hide();
}
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
this.Show();
}
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 15);
}
}
private void pictureBox3_Click(object sender, EventArgs e)
{
TabPage page = new TabPage("Tab");
tabControl1.TabPages.Add(page);
WebBrowser wb = new WebBrowser();
wb.Dock = DockStyle.Fill;
page.Controls.Add(wb);
TabPage tp = tabControl1.SelectedTab;
tp.Controls["wb"].Text = string.Format("kjh", (tabControl1.SelectedIndex + 1).ToString());
}
private void pictureBox2_Click(object sender, EventArgs e)
{
tabControl1.SelectedTab.Dispose();
}
private void Back_Click(object sender, EventArgs e)
{
WebBrowser wb = tabControl1.SelectedTab.Controls[0] as WebBrowser;
wb.GoBack();
}
private void Forward_Click(object sender, EventArgs e)
{
WebBrowser wb = tabControl1.SelectedTab.Controls[0] as WebBrowser;
wb.GoForward();
}
}
}
|
|
|
|
|
jay_t55 wrote:
TabPage page = new TabPage("Tab");
tabControl1.TabPages.Add(page);
WebBrowser wb = new WebBrowser();
wb.Dock = DockStyle.Fill;
page.Controls.Add(wb);
TabPage tp = tabControl1.SelectedTab;
tp.Controls["wb"].Text = string.Format("kjh", (tabControl1.SelectedIndex + 1).ToString());
OK, I got it. I wonder why you didn't get error!
you have to set the Name property of your control (or its Index) in tp.Controls, like this:
TabPage page = new TabPage("Tab");
tabControl1.TabPages.Add(page);
WebBrowser wb = new WebBrowser();
wb.Dock = DockStyle.Fill;
wb.Name = "WebBrowser1";
page.Controls.Add(wb);
TabPage tp = tabControl1.SelectedTab;
tp.Controls["WebBrowser1"].Text = string.Format("kjh", (tabControl1.SelectedIndex + 1).ToString());
tp.Controls["wp"] returns null and you didn't get error in tp.Controls["wp"].Text = ... , really Weird!
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
Hello, Thanks again
Here's what I got, now:
private void pictureBox3_Click(object sender, EventArgs e)
{
TabPage page = new TabPage("Tab");
tabControl1.TabPages.Add(page);
WebBrowser wb = new WebBrowser();
wb.Dock = DockStyle.Fill;
wb.Name = "WebBrowser1";
page.Controls.Add(wb);
TabPage tp = tabControl1.SelectedTab;
tp.Controls["WebBrowser1"].Text = string.Format("WebBrowser1", (tabControl1.SelectedIndex + 1).ToString());
tp.Controls["wp"].Text = string.Format("wp", (tabControl1.SelectedIndex + 1).ToString());
}
...But, When I debug, and then click on pictureBox3(add tab button) it brings up a debug error: "object reference is not set to an instance of an object"... it doesnt even open a new tab any more hahaha... Any ideas?
thanks,
j.t.
|
|
|
|
|
jay_t55 wrote: tp.Controls["wp"].Text = string.Format("wp", (tabControl1.SelectedIndex + 1).ToString());
What is "wp"? Did you mean "wb"? Even with "wb" you'll get this error. wb is an object, as I told before, you have to set the object's Name property in tp.Controls, as you did in this line:
jay_t55 wrote: tp.Controls["WebBrowser1"].Text = string.Format("WebBrowser1", (tabControl1.SelectedIndex + 1).ToString());
Clear this line:
jay_t55 wrote: tp.Controls["wp"].Text = string.Format("wp", (tabControl1.SelectedIndex + 1).ToString());
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
thank you,
i have this:
TabPage page = new TabPage("Tab");
tabControl1.TabPages.Add(page);
WebBrowser wb = new WebBrowser();
wb.Dock = DockStyle.Fill;
wb.Name = "WebBrowser1";
page.Controls.Add(wb);
TabPage tp = tabControl1.SelectedTab;
tp.Controls["webBrowser1"].Text = string.Format("webBrowser1", (tabControl1.SelectedIndex + 1).ToString());
tp.Controls["webBrowser1"].Text = string.Format("webBrowser1", (tabControl1.SelectedIndex + 1).ToString());
..and it still gives the same error message ..totally weird :-p
|
|
|
|
|
C# is Case-Sensitive which means 'A' is not equal to 'a'.
You named your wb , "WebBrowser1" (look at 'W', it's Capital) and told to tp that I have a control named "webBrowser1" (did you see 'w'?) and tp tried to find that but nothing found and got this error. Do you understand?
And why did you write this line twice?
jay_t55 wrote: tp.Controls["webBrowser1"].Text = string.Format("webBrowser1", (tabControl1.SelectedIndex + 1).ToString());
tp.Controls["webBrowser1"].Text = string.Format("webBrowser1", (tabControl1.SelectedIndex + 1).ToString());
Clear one of them and change "webBrowser1" to "WebBrowser1"
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
Sorry about that muck up before.
Here is the code that I have as of your last post:
private void pictureBox3_Click(object sender, EventArgs e)
{
TabPage page = new TabPage("Tab");
tabControl1.TabPages.Add(page);
WebBrowser wb = new WebBrowser();
wb.Dock = DockStyle.Fill;
wb.Name = "WebBrowser1";
page.Controls.Add(wb);
TabPage tp = tabControl1.SelectedTab;
tp.Controls["WebBrowser1"].Text = string.Format("WebBrowser1", (tabControl1.SelectedIndex + 1).ToString());
}
Although it still tells me "object reference not set to instance of an object." and it points to the following line:
tp.Controls["WebBrowser1"].Text = string.Format("WebBrowser1", (tabControl1.SelectedIndex + 1).ToString());
Regards,
j.t.
|
|
|
|
|
Oooooooooh,
Why didn't I notice before?
A WebBrowser control does NOT support the Text property!!!!
But why did you get NullReferenceException?!!
I tried this code and did work for me well:
TabPage tp = new TabPage("Tab");
tabControl1.TabPages.Add(tp);
WebBrowser wb = new WebBrowser();
wb.Name = "WebBrowser1";
wb.Dock = DockStyle.Fill;
tp.Controls.Add(wb);
TabPage p = tabControl1.SelectedTab;
(p.Controls["WebBrowser1"] as WebBrowser).DocumentText = "Hello!";
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
You, Pedram, are a genius! Thank you so much for letting me pick at your brain! You have just solved my problem that i have had for the last 6weeks.
Regards,
j.t.
p.s.
if you would like to help me again, (just general advice), i need to create a "DocumentCompleted" event handler for the WebBrowser1 control. But I don't know how to do this programatically since there isn't one on my form design. Any advice would be much appreciated.
best regards,
jason.
|
|
|
|
|
No problem
jay_t55 wrote: (just general advice)
Search Google, MSDN and CP articles for your will, they're more helpful and faster. If you got any problem, ask it here and if anybody can help, surely will help you. Good Luck
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
I recently made a program for organizing marks and realized that it is slow and repetitive to type the same teacher's name 20 times for students in the same class.
I chose to add a little copy and paste feature when the user presses ctrl+v and the active cell becomes the contents of the clipboard.
Here is the snippet:
else if (e.Control && e.KeyCode == Keys.V)
{
if (Clipboard.ContainsText() & dataGridView1.CurrentCell.OwningColumn.Index == 4)
{
dataGridView1.CurrentCell.Value = Clipboard.GetText();
}
if (dataGridView1.CurrentCell.OwningRow.Index == nUD_counter)
{
dataGridView1.Rows.Add();
}
}
What I'm having problems with is the last part, where I add another row (Microsoft made it so it would automatically add a row if the cell is edited by the user, but not programatically. The problem is that when I add the new row, it places it above the row which I just pasted info into such that:
col1 col2
a b
<-blank line where I press ctrl+v->
It becomes
col1 col2
a b
<-blank line where I press ctrl+v->
hi
How can I fix this? Also feel free to make suggestions on my code.
Thanks in advance.
modified on Saturday, November 1, 2008 5:23 PM
|
|
|
|
|
I messed around with it a bit and ended up using SendKeys. I know this isn't the best method, but its the only one I tried so far that works.
Basically,
try
{
dataGridView1.BeginEdit(true);
String tempText = Clipboard.GetText();
tempText = tempText.Replace("{", "{{}");
tempText = tempText.Replace("}", "{}}");
tempText = tempText.Replace("{{{}}", "{{}");
tempText = tempText.Replace("(", "{(}");
tempText = tempText.Replace(")", "{)}");
tempText = tempText.Replace("+", "{+}");
tempText = tempText.Replace("^", "{^}");
tempText = tempText.Replace("%", "{%}");
tempText = tempText.Replace("~", "{~}");
SendKeys.Send(tempText);
SendKeys.Send("{DOWN}");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\n\nThe previous value was restored.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
dataGridView1.CurrentCell.Value = previousValue;
}
|
|
|
|
|
Hi,
I need to generate an ordered sequence of numbers from 1 - 9. At no point is any number allowed to be used twice.
There are 81 combinations.
So it would look something like this:
123456789,
192345678,
193456782,
194567823,
195678234,...
and so on.
Thanks
|
|
|
|
|
Hi,
that has been asked and answered here[^].
And there are 9! permutations (that's 362880, not 81).
|
|
|
|
|
i have a datatable contain 3 columns(id,type,price);
and a sqldatareader have a 1 column(name);
i want to add the column(name) from sqldatareader to datatable
using datacolumn,,
please how I can do that??
thanks all
|
|
|
|
|