|
Never mind, found the answer. You have to make the assembly COM visible.
Marc
Pensieve
Some people believe what the bible says. Literally. At least [with Wikipedia] you have the chance to correct the wiki -- Jörgen Sigvardsson
|
|
|
|
|
Hi guys,
Please help! I have a form with combo box and a bunch of text boxes, when the form is opened I am populating the combo box and the text boxes with data from a table. My question is that when I delete one of the field data on the combo box, I still see it in the drop down menu. How can I refresh it or reload it so I don't see the deleted data. Please help!!!
sasa
|
|
|
|
|
If you're binding the comboboxes to a datatable, then it should automatically refresh. You may want to try .EndEdit() on the row after you have deleted it.
|
|
|
|
|
EndEdit() function doesn't exist, I tried EndUpdate() and no luck. I am not binding the data. How do I bind data?
sasa
|
|
|
|
|
Nevermind, I got it to work by doing a clear. This is what I am doing now. I am using the combobox.items.add() property and then when I am done editting or deleting I am using combobox.items.clear(); and then recalling my populate function which adds the data back to the combobox.
It seems to work well.
Thanks for your help though.
sasa
|
|
|
|
|
For example now is tuesday 20/6/2006, how can i do to cout the number of tuesday from 1/1/2006 to now.
Help me huhuhu
I tried so hard and got so far
|
|
|
|
|
Hmmmmmm sounds like another homework assignment. You will not get a your homework done by us, however I can give you a direction to head:
Think: DateTime.AddDays() and DateTime.DayOfWeek along with a for loop.
|
|
|
|
|
System.DateTime today = System.DateTime.Now;
int iDOY = today.DayOfYear();
The above will tell you (in iDOY) what day of the year the current date is (i.e. number between 1 and 366).
Tom Delany
|
|
|
|
|
For testing purposes, I created a simple Word 2003 Template with 2 fields. I then set the protection level to "Filling in Forms". The template itself is fine and works as expected within Word. In other words, when I open the template in Word, I am presented with a new document in which I can only enter values in the two supplied fields and save the document.
Also for testing purposes, I wrote a C# app to automate filling in my sample template. In my C# app, I start word, open the template, find a field, and attempt to enter a value.
object bookmark = "Text1";
Word.Bookmark myBookmark = myWordTemplate.Bookmarks.get_Item(ref bookmark);
myBookmark.Select();
myBookmark.Range.Text = "Hello";
Upon trying to assign a value to the field, I get an exception stating the value can't be changed because protection is enabled. Since the protection level is set to "Filling in Forms", does anyone have any idea why this exception is being thrown? Or is the above not the proper way to fill fields defined in a word template?
Last, please note that if (in my code) I disable protection, write my value, re-enable protection, and save the document, my code works but with the following unwanted side effects:
- Within my C# app, the field/bookmark object gets overwritten/deleted, as in it gets deleted from the field/bookmark collection.
- My first comment is confirmed by opening the resulting document in Word -- any field to which I assigned a value (in code) is no longer there. The value I wrote is there and in the proper place, but the template itself is basically destroyed. In other words, when I automate filling in the form, the user isn't able to open the resulting document and make any changes like they could if they manually filled in the form with Word.
Any suggestion or workaround would be appreciated.
Vince
|
|
|
|
|
It seems I gave up a bit too soon. So, to answer my own question... this works.
object bookmark = "Text1";
myWordTemplate.FormFields.get_Item(ref bookmark).Result = "Hello";
|
|
|
|
|
Hi
I am trying to submit multiple submission through textarea.(ASP.NET/C#)
For instance, I'd allow user to submit group of number(i.e. 11111, 22222, 33333, 44444, etc)
The issue is user can submit up to 50 numbers(submission) and the system doesn't know how many numbers s/he will exactly submit. It could be 1 or 2, or 45 or 50.
I guess I can't use standard array with split function because there's no numbers declared.
Anyone has any idea?
Thank you!
|
|
|
|
|
edgtr wrote: I guess I can't use standard array with split function because there's no numbers declared.
Not sure what you mean by that, but yes you would split the text and (in VS2005) that would give you an array of numbers entered. From there you can use array.Length to validate that they have not exceeded the maximum and then a for loop to trim and convert each item into a number.
The only minimum requirement you would have is that the separator must be consistent and it must be entered for between every number.
string[] enteredList = entry.Text.Split(',');
foreach (string number in enteredList)
{
try
{
int value = Convert.ToInt32( number.Trim() );
}
catch
{
errorMessage.Text += number + " is not a valid number ";
}
}
|
|
|
|
|
" class to be both marked with the serializable attribute and extend MarshalByRefObject "
when will we use this concept.
-- modified at 23:28 Monday 19th June, 2006
|
|
|
|
|
Why do you ask? What put this question into your mind?
Josh
|
|
|
|
|
Hi,
I am looking for C# interview style programming problems for my self to practice with. I would like to
find some material that tests problem solving skills, efficiency of implementation as well as knowledge of
the language, though not overly complicated.
Something along the lines of algorithm implementation like fibonacci series, problems that ought not to
take more that say 20 mins max to solve. I'd appreciate your comments, suggestions, links, resources, ect.
P.S. Can anyone recommend C# equivalent books to "Effective C++" & Efficient C++"?
|
|
|
|
|
antoan wrote: P.S. Can anyone recommend C# equivalent books to "Effective C++" & Efficient C++"?
Effective C# by Bill Wagner
|
|
|
|
|
|
Colin Angus Mackay wrote: How about reading this forum. You'll find all manner of badly worded, ambiguous, incomplete questions that you are likely to find in many interview situations where the company hasn't got a clue what it is doing.
So true!! So true that it hurts. Some of the questions on these boards are so poorly worded, it seems like the person was violently throwing up while writing.
Josh
|
|
|
|
|
Some of us try!
|
|
|
|
|
check out www.mathschallenge.net
register free for "project euler" lots of good programming problems.
Best regards
//
Daniel Persson
|
|
|
|
|
|
hello
Could you please tell me how to delete entries in HKLM of windows registry(regedit) in c#.NET
Yogesh_T
|
|
|
|
|
Microsoft.Win32.RegistryKey.DeleteSubKey(String)
|
|
|
|
|
Hi!!
During my trainship I have to write a code that allows you to scroll the image using the arrow keys and, unfortunately, it's the first time I'm working with C#.net. Moreover, there should also be a button-quartett-structure, that is, 4 buttons each scrolling the image into different directions (up, down, right, left). To be more precise:
private void btnUp_Click(object sender, System.EventArgs e)
{
moveUp();
}
private void moveUp()
{
}
I'm familiar with C-language, but I have little more than no experience with object-oriented languages. Has anyone any idea which could be helpful to me??
|
|
|
|
|
An easy way would be to add a PictureBox (pictureBox2) to your PictureBox (pictureBox1). pictureBox2 will display the actual image. In the moveUp() handler, set you can change the location of pictureBox2:
private void moveUp()
{
Point currentLocation = pictureBox2.Location;
pictureBox2.Location = new Point(currentLocation.X, currentLocation.Y - 1);
}
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Goof around music jam with my brothers (with video)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|