|
It is pretty simple though. Make sure you add
using System.Threading;
private void btn_StartLoad_Click(object sender, EventArgs e)<br />
{<br />
ThreadStart startload = new ThreadStart(startUpload);<br />
Thread threadload = new Thread(startload);<br />
threadload.Start();<br />
}<br />
<br />
private void startUpload()<br />
{<br />
} Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
ok Thanks I will check it out
|
|
|
|
|
Hi,
I want to get installed Word applications Author name using windows form.
I manage to get the whether word application is installed or not. But Now I want Author name of that word application.
So How can get it ?
Thanks
sjs
|
|
|
|
|
Hi,
I don't know if you've looked into it already, but have a look at Word Automation.
Here's a link I found that enables you to get the 'Author' property of a Word Document:
http://support.microsoft.com/default.aspx/kb/303296[^]
It may not be exactly what your after but it may help you on the right path.
There's also this link about Word Automation in general[^].
Hope it helps.
[Edit]
If it's not in there, then check out the Registry[^], it may be a setting in there.
Laters.
"If you can't explain it simply, you don't understand it well enough" ~ Albert Einstein
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair
modified on Saturday, March 6, 2010 3:22 AM
|
|
|
|
|
I'm trying to access the protected member PointInLink() from LinkLabel.
I've been able to get at it doing the following:
private void LinkLabel_MouseHover(object sender, EventArgs e)
{
Point p = MyLinkLabel.PointToClient(new Point(Cursor.Position.X, Cursor.Position.Y));
ProtLL pll = new ProtLL();
LinkLabel.Link lnk = pll.GetLink(p.X, p.Y);
if (lnk != null)
{
}
}
class ProtLL : LinkLabel
{
public Link GetLink(int x, int y)
{
return PointInLink(x, y);
}
}
The thing is, "lnk" is always null, since PointInLink has no idea which LinkLabel it's looking at. I can't seem to pass "MyLinkLabel" as an argument in GetLink(), as it then hides the PointInLink member again.
Is accessing PointInLink just not possible or am I going about it the wrong way?
Thanks in advance.modified on Saturday, March 6, 2010 1:27 PM
|
|
|
|
|
Yes It always return null
because you are using new ProtLL instance
I think you have to use ProtLL object in your form insted of LinkLabel
beacuse it is aleady inherited in ProtLL
Life's Like a mirror. Smile at it & it smiles back at you.- P Pligrim
|
|
|
|
|
Hi and thanks for the response.
If I create the LinkLabel using ProtLL, I still cannot access PointInLink.
Ultimately, what I'm trying to do is get what link is under the mouse cursor in a LinkLabel control.
Edit---------------
Khaniya,
You were right, too. I messed up my test bed.
Thanks to you, too!modified on Saturday, March 6, 2010 3:07 PM
|
|
|
|
|
swo.priv wrote: Ultimately, what I'm trying to do is get what link is under the mouse cursor in a LinkLabel control.
Surely then you should use the MouseHover Event[^] of the LinkLabel[^] Control?
"If you can't explain it simply, you don't understand it well enough" ~ Albert Einstein
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair
|
|
|
|
|
That would be an ideal way to do it, if the MouseEventArgs contained data related to the link that was under it. Also, the MouseHover event uses EventArgs, anyway.
The only event I've seen that holds data related to the links is LinkLabelLinkClickedEventArgs.
Is there a way to use different EventArgs from other events?
|
|
|
|
|
swo.priv wrote: hat would be an ideal way to do it, if the MouseEventArgs contained data related to the link that was under it. Also, the MouseHover event uses EventArgs, anyway.
Why is this a problem? You know which LinkLabel you are in because MouseHover tells you in the "sender" param - all you have to do is cast it to a LinkLabel or derivative:
LinkLabel l = sender as LinkLabel;
if (ll != null)
{
...
} or
ProtLL pll = sender as ProtLL;
if (pll != null)
{
...
} You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
A LinkLabel can contain a string of text, broken in to several links, within a single LinkLabel control. I'm trying to get the link that is hovered, not which LinkLabel.
For example, a string could be "the quick brown fox." That could be broken in to links. "The quick" could be a link by itself, "brown" could be a second link and "fox" could be a third link. All three links can be inside the same LinkLabel. The problem is getting which link is being hovered.
This is why I'm trying to get access to the PointInLink(). The equivalent for a ListView is GetItemAt(). An example using the ListView version would be:
Point p = lv.PointToClient(new Point(Cursor.Position.X, Cursor.Position.Y));
ListViewItem lvi = lv.GetItemAt(p.X, p.Y);
What I need is the LinkLabel version of that. Another solution would be if I could get the hovered state of a link, run my links through a loop checking their states, and return the hovered one, but I cannot find a way to do that, either.
|
|
|
|
|
Yes. So?
private void linkLabel1_MouseHover(object sender, EventArgs e)
{
ProtLL pll = sender as ProtLL;
if (pll != null)
{
Point p = pll.PointToClient(new Point(Cursor.Position.X, Cursor.Position.Y));
System.Windows.Forms.LinkLabel.Link l = pll.GetLink(p.X, p.Y);
}
}
I assume you are using your ProtLL class instead on LinkLabels on your form? Otherwise, no, you can't access it. If you only have the one ProtLL you are interested in, then use it's name directly instead of casting it.You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
I could have sworn I tested exactly what you said and it didn't work (as indicated previous).
You provoked me in to setting up my test again and this time it did work. I must have overlooked something in my old test.
Thank you so much! I truly appreciate it!
|
|
|
|
|
|
Where are you defining the length of "count"? CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
I have a data application that is using a DataSet via the designer.
I'm trying to create a form that binds data from one table "MyData". One of the fields "picker_fk" uses an FK relationship to a second table "Picker". "Picker" has only one field in it called "descript" (not null, unique).
In the form, I set up the DataGridView to use the DataSet.MyData table. For the combo box column, I set the following properties:
DataPropertyName = "picker_fk"
DataSource = bndPicker (a binding source that uses the "Picker" table from the DataSet)
DisplayMember = "descript"
ValueMember = "descript"
This is all good until I create a new row, select a value from the combo box, and then move focus away. I get a message:
SystemArgumentException: Column "descript" is not belong to table "Picker".
What's up with that? I'm looking right at the field in the DataSetDesigner. "descript" is the ONE AND ONLY field in "Picker". How can the debugger say it's not in there?
I dug around and found a suggestion that this error could occur with data type mismatches. But I have verified that both Picker.descript and the referencing MyData.picker_fk are both of type System.String.
Does anyone have any ideas?
|
|
|
|
|
Never mind. I found it. The error message is actually misleading because it doesn't have to do with the names. It has to do with the sequence in which databinding takes place. I set up the BindingSource for the grid BEFORE the BindingSource for the ComboBox options. It's odd that this error was not detected right away but only after adding a row, but I'm not the only one to experience this:
http://adamhouldsworth.blogspot.com/2009_04_01_archive.html[^] (Scroll down to the 7 April 2009 entry "Data Binding Pitfall").
|
|
|
|
|
What is the format needed for Intellisense to pick up on my comments for my enums? So when I type “MyEnum.ItemOne” the intellisense will display the documentation I’ve written for “ItemOne”?
Also, is there some sort of command I can use in Visual Studio that will generate a compile error if I don’t use all possible Enum values in a switch statement? I’m looking for a compile-time dummy catch incase I add an extra Enum value later but might miss a statement that should switch on all possible values of the Enum.
Thanks!
|
|
|
|
|
public enum Blah
{
Terror,
Nitro
}
[Edit]Fixed "<" signs
For Point 2: Not that I know of.
But It shouldn't be too hard to create a method that checks each enumeration used.
[/Edit]
|
|
|
|
|
Thanks, works perfectly! I was trying variations on
public enum MyEnum
{
ItemOne
}
with no success =/
|
|
|
|
|
what the System.Terror?
It sure does. If you mess with it you're f... modified on Friday, March 5, 2010 6:33 PM
|
|
|
|
|
Anticast wrote: a compile error if I don’t use all possible Enum values
nope.
you could come up with extra code that performs some checks, but it isn't straightforward.
|
|
|
|
|
If you use "tab tab" for the switch it will automatically put in all cases
|
|
|
|
|
that's a good one. i had no ideea. thanks
|
|
|
|
|
I didn't know this until recently, when I did it by accident - imagine the chances of that happening !
|
|
|
|