|
The WSDL tool has a command line switch to reuse classes from specifed assemblies instead of creating new ones. You can specify your assembly there. I don't know the exact switch though
|
|
|
|
|
Hello, I've been wondering all day, how would I add a button to a windows form that opens the main browser, and connects to a site. It is coded in C#, Everything is finished, just, I do not know how to( If Possible) connect to a site, Via Button. It is also in .Net 3.5
Again, thanks.
|
|
|
|
|
System.Diagnostics.Process.Start("http://www.google.com");
|
|
|
|
|
Thanks alot. For the quick reply, and also the working Line <3
|
|
|
|
|
or better yet:
System.Diagnostics.Process.Start("
http://www.google.be/search?q=how+would+I+add+a+button+to+a+windows+form+that+opens+the+main+browser");
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
I googled that first one, and came up with that whole site. Its going to save me, and others, hours of wasting time.
Though, thanks.
|
|
|
|
|
Even better:
System.Diagnostics.Process.Start("http://lmgtfy.com/?q=how+would+I+add+a+button+to+a+windows+form+that+opens+the+main+browser");
|
|
|
|
|
Hi
i have a datatable and i want to print it.
what is the best way for it?
(maybe by showing datatable in gridview and then print the gridview;how can i print gridview?)
please somebody help me.
|
|
|
|
|
|
the columns of this datatable isn't clear because this datatable is reply of a select command from database and user can modify number of datatable columns .
you know that i can't change the columns of crystal report .
if you know another way please help me.
|
|
|
|
|
|
I am adding new object in array..and each object I add also to listview. Now i would like to read object that is selected on listview. How I know which object is now selected?
|
|
|
|
|
all selected object are placed in ListView.SelectedItems. It is used in a same way as ListView.Items
|
|
|
|
|
object[] arr = new object[100];
foreach(ListViewItem item in listView1.SelectedItems) {
object selObj = arr[item.Index];
}
|
|
|
|
|
I use
List < blabla > array ... is use of this same as of normal array?
|
|
|
|
|
Yes
example:
List<String> str = new List<String>();
str.Add("Hello");
str.Add("World");
MessageBox.Show(str[0] + " " + str[1]);
|
|
|
|
|
a generic list (e.g. List<int> ) is like a stretchable array, it will grow and shrink as you add/remove items. And you can access its elements using an index, and you can iterate its elements with foreach .
it is all in the documentation!
BTW: if all your objects are in a ListView, then listView.Items is holding them all; so you can index and iterate that directly. (Not a good idea if you need a layered approach, where the ListView is just part of the view, not of the business logic).
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Yes, you can use a generic list exactly like an array in your C# program. The compiler handles the translation chores for you
|
|
|
|
|
Hello @ all
I have a problem with my generated PNG - Images.
It's a bit strange for me but may be someone now what i can do to solve this problem.
My windows service create on the fly PNG - Images and store them as binary in a database.
The stored images are displayed later with a crystal report in a windows app.
That works very fine since years and also with different pc's (most XP-OS), but there is a problem with a new PC (XP-OS) since a few days.
All images are displayed shrunken in the reports and it's not the whole report.... only the images. Text- and Report still proportional.
Could it be that something is missing at the new machine ?
Any ideas how this could be ?
Thanks a lot!
Bitmap couponImg = null;
Font font = null;
Graphics graphic = null;
try
{
couponImg = new Bitmap(coupon.Width, coupon.Height, PixelFormat.Format24bppRgb);
using (graphic = Graphics.FromImage(couponImg))
{
graphic.Clear(coupon.BackgroundColor);
graphic.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
graphic.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
graphic.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
graphic.TextContrast = 0;
graphic.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
graphic.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
if (coupon.couponCellCollection != null && coupon.couponCellCollection.Count > 0)
{
for (int idx = 0; idx < coupon.couponCellCollection.Count; idx++)
{
font = new Font(coupon.font, (float)coupon.couponCellCollection[idx].fFontSize, FontStyle.Bold, GraphicsUnit.Millimeter);
graphic.DrawString(coupon.couponCellCollection[idx].sCellValue, font, Brushes.Black, new PointF(coupon.couponCellCollection[idx].iPosX, coupon.couponCellCollection[idx].iPosY));
font = null;
}
}
graphic.DrawImage(couponImg, new Rectangle(0, 0, coupon.Width, coupon.height), 0, 0, coupon.Width, coupon.height, GraphicsUnit.Pixel);
graphic.Flush();
}
}
}
catch (Exception)
{
couponImg = null;
}
finally
{
if (graphic != null)
{
graphic = null;
}
}
|
|
|
|
|
Hi
Got stuck here. Word document gets saved in the correct directory with the correct name but the typed text doesn't persist. Please help. (*I have tested that the text is actually typed in the active document).
private void SaveDoc()
{
Word.Application wdApp;
Word.Document wdDoc;
wdApp = new Word.Application();
wdDoc = wdApp.Documents.Add(ref missing, ref missing, ref missing, ref missing);
//type some text
wdApp.Selection.TypeText("Some Heading"));
//set rtf doc paragraph 1 style to normal
object wdParaStyleName = "Heading 1"
wdDoc.Paragraphs[1].set_Style(ref wdParaStyleName);
//save rtf doc
wdApp.ChangeFileOpenDirectory("C:\\test\\");
object wdFileName = "TestDoc.rtf"
object saveFmt = Word.WdSaveFormat.wdFormatRTF;
wdApp.ActiveDocument.SaveAs(ref wdFileName, ref saveFmt, ref falseO, ref missing, ref falseO, ref missing, ref trueO, ref falseO, ref falseO, ref trueO, ref falseO, ref missing, ref falseO, ref falseO, ref missing, ref falseO);
//Quit Word
object saveChanges = Word.WdSaveOptions.wdDoNotSaveChanges;
wdApp.Quit(ref saveChanges, ref missing, ref missing);
}
Using doc.save() prompts the save dialog which defeats the purpose of automation.
Thanks
GJ
|
|
|
|
|
mailtogj wrote: object saveChanges = Word.WdSaveOptions.wdDoNotSaveChanges;
Documentation: This example includes the wdDoNotSaveChanges argument of the Close method to close without saving changes or prompting the user.
Try using the SaveAs() method.
|
|
|
|
|
object saveChanges = Word.WdSaveOptions.wdDoNotSaveChanges; This saves without the inserted text.
SaveAs() also doesn't work for inserting text. Could i possibly catch the save as event for the word application.
|
|
|
|
|
Hi all,
I am trying to catch the delete event from an Outlook appointment item. I can
get it working using the "Item.BeforeDelete" event but if the appointment is
a recurrence and you delete one occurence from the recurrence the
event is'nt triggered. Does any one know a way around this ?
Many thanks in advance
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|