|
Thanks for the nice tip! 
|
|
|
|
|
anyone have a c game that uses a matrix and kills off char's
given a condition????
Help ME
|
|
|
|
|
All,
Can anyone direct me to some quality articles on how to create Web Parts for SharePoint with C#?
-Mabuti
|
|
|
|
|
Quality? No. We've been looking into SharePoint for quite some time. The best you can do is find typical "Hello, world!"-type examples. MSDN[^] has a few, and you can always google which is how we found as little as we did.
Welcome to the hell that is SharePoint documentation!
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have to agree 100%. I was put on the task of looking into coding some custom sharepoint webparts for our company and after finding virtually no documentation on it we concluded it would be cheaper just to purchase some pre-made web parts.
|
|
|
|
|
Can a column in a DataTable have ArrayList as a type?
thanks
|
|
|
|
|
DataColumn.DataType supports only the base types in .NET. See the property documentation in the .NET Framework SDK for more information.
Besides, even if it could you would have problems getting/setting that from/in a database if you use a DataAdapter or anything, as well as displaying it in data-bound controls like the DataGrid , which would force you to implement your own DataGridColumnStyle making your DataSet and your data-bound controls tightly coupled.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
how do i load .tiff images into a document and print them.
i want to build the document first with all the images and just send the document to be printed
chad
|
|
|
|
|
If you're referring to a document format like Word documents, then you need to use the Office PIAs which providing printing methods.
If you want to create a conceptual document that merely holds a list of images, then it's a different story.
You could, for example, extend PrintDocument and add an ArrayList or something that contains images. In your print event overrides you need to not only enumerate those images (not in the handler, mind you, but keeping track of the position since the PrintPage event is called once per printed page) but determine whether or not one image will fit on a page in whole or in part. There are plenty of examples of this both on MSDN[^], CodeProject (I believe), and elsewhere on the web. It's really not difficult, though, you just have to keep track of state or decide to resize your images - or allow for both and use a user preference to determine which way to go.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
would this print out more the one copy of my image . if not what would i have to change
public string[] files=new string(2)
Private Sub printButton_Click(sender As Object, e As EventArgs)
Try
files[0]= "C:\My Folder\MyFile.bmp"
files[1]= "C:\My Folder\MyFile.bmp"
' Assumes the default printer.
Dim pd As New PrintDocument()
AddHandler pd.PrintPage, AddressOf Me.pd_PrintPage
pd.Print()
Catch ex As Exception
MessageBox.Show("An error occurred while printing", _
ex.ToString())
End Try
End Sub
' Specifies what happens when the PrintPage event is raised.
Private Sub pd_PrintPage(sender As Object, ev As PrintPageEventArgs)
' Draw a picture.
ev.Graphics.DrawImage(Image.FromFile(files[0]), _
ev.Graphics.VisibleClipBounds)
ev.HasMorePages = True
ev.Graphics.DrawImage(Image.FromFile(files[1]), _
ev.Graphics.VisibleClipBounds)
' Indicate that this is the last page to print.
ev.HasMorePages = False
End Sub
chad
|
|
|
|
|
You're trying to print both images to the same page and in the same position. As I mentioned, you must keep track of state so that you print only one image per page or print them in succession. As I also mentioned, PrintPage is fired once per page.
Also, this is the C# forum, not the VB.NET forum. You even mixed C# and VB.NET, which wouldn't work in the same source file (or even the same project if you're using VS.NET as opposed to command-line compiling with two modules in the same assembly).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
sorry about the vb.net and c# code mixed i copied and modified it from msdn to past it here i don't understand what you men keep track of state can you give me a code example i can't seem to find a print that uses more than one page
chad
|
|
|
|
|
Like the array index in between calls to your PrintPage event handler. Declare a field, like private int index = 0; . With each call to your PrintPage event handler, use that index to get the image in your array and then increment it so that with the next page to print you grab the next image, and so on.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
this is what i tryed and it still does not work
cntfiles is the current page i'm printing i att one to it on each call
pages is the total pages
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
System.IO.FileStream fs ; //create a filestream to open the image
fs= new FileStream(files[cntfiles],System.IO.FileMode.Open,System.IO.FileAccess.Read);
Image newImage = Image.FromStream(fs);
// Create Point for upper-left corner of image.
//Point ulCorner = new Point( 1, 1); //point to start image at
//e.Graphics.DrawImage(newImage, ulCorner);
e.Graphics.DrawImage(newImage, destRect);
fs.Close();
if(cntfiles
|
|
|
|
|
Hi All,
For my .NET C# windows application, I am building the installation setup using "Setup & Deployment" project. At the end of installtion it places a shortcut on users's desktop ( the way I want)
But the problem is if I want to specify some command line parameters I right click the shortcut--> go to properties, but what I see is "Target" as non-editable field.
So to specify some command line params I need to go to "Program Files"/"Appl Folder" and create a new shortcut to the excutable to specify command line params.
Any clues as to how I can set property such that at the end of installation the shortcut that installation places on desktop has editable "Target".
Thanks
Ruchi
|
|
|
|
|
This is because the Windows Installer projects in VS.NET suck. Trust me - I've worked with Windows Installer for as long as it's been out and the Visual Studio projects are always poor.
It is possible, just not using VS.NET. Good developer environments like Wise for Windows Installer[^] (cheaper, just as capable) and InstallShield Developer[^] (much more expensive, includes proprietary install projects, too) make this a trivial operation.
If you want to do this, you must Orca afterward and modify MSI tables directly.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
This property is set when you click the Next button in the folder selection dialog, which also has a radio button group with "Everyone" and "Only you" (or something like that) below the folder selection text box and button. If you want to default that to ALLUSERS = 2 then you'll have to use a tool like Orca (comes with the Windows Installer SDK) to put that property in the Property table.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks a ton. It works.
I have another question about setup project, but I will post it as separate thread.
Thanks alot
Ruchi
|
|
|
|
|
I need a listbox that contains a variable numbers of images in each row(Only images).
Is there an example of this somewhere, or should i use something else than a listbox?
Each row shall be sorted by the first image, second image, and so on.
Thanks
Thomas
|
|
|
|
|
I've never tried this, but it seems simple enough...
You could just put a panel on your form. Turn autoscroll to true and programatically add a picture box to the panel for each picture. If a picture box is off the panel scroll bars will appear (According to the panel documentation).
It may be more efficient to just draw your images to the panel rather than using the picture box, but I am not sure. If you do jsut try drawing the images you will probably have to manage the scroll bars.
|
|
|
|
|
I am inserting articles in a textbox. This is later displayed by id on a page. Since each article may include images etc. I need to be able to insert the html code along with the article content. How can i format my textbox so i can insert the contents into a table?
I get an error when i try to add the html tags.
error --->A potentially dangerous Request.Form value was detected from the client (txtbooktext="...LEASE:
|
|
|
|
|
got it working by adding to the top page directive ValidateRequest="false"
|
|
|
|
|
Not a good idea. See my post below.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
This really belongs in the ASP.NET forum, but I'll answer anyway.
ASP.NET checks for potentially dangerous content, such as HTML being passed back to the server because it could contain server-side script that would pose a security risk.
Instead, implement a bit of javascript that is executed before the form is submitted that will encode the HTML (i.e., changes things like < to <, etc.) and then submit it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi all,
Our current applications use MFC Serialize to create our files, using the standard MFC rules.
The bosses that be wish our new .NET apps to read in these old files so we have an upgrade path for our users.
Is there an easy way to read in the MFC created file in a way much like the MFC Serialize function? i'd prefer not to have to read it in as a binary stream and work on it that way?
Any ideas?
Thanks
|
|
|
|