|
DataGridView1.RowHeadersVisible = false;
thanks
|
|
|
|
|
how to print a page in a protrate design.
thanks
|
|
|
|
|
printDoc.PrinterSettings.DefaultPageSettings.Landscape=false (or =true);
did it for me.
Luc Pattyn
|
|
|
|
|
I am trying to take text data from a listview in my program and print it in a report. Im new to printing anything in any language. I have followed this article[^] only to get part of what i need. the error that i have is the part where it actually prints the elements, it wont, it just does the header and footer. but what i would like to know is does anyone know of a good tutorial i can follow to print text from a listview?
|
|
|
|
|
Try using the PrintDocument class
SkyWalker
|
|
|
|
|
Hi, happy new year for all.
I wanted to make a full-screen windows application, but after changing the
height and width properties of form, the start menu still visible over the
form, is there any way to make a full-screen application? and also cover the
start menu.
please excuse my bad English >> (I'm new at learning English)
|
|
|
|
|
Set the FormBorderStyle property to None and the WindowState property to Maximized
SkyWalker
|
|
|
|
|
thanks, it worked.
but suppose i want the application with border, covering the whole screen, it migth look like the old setup wizards, is that possible.
|
|
|
|
|
Of course! Set the following:
FormBorderStyle to Fixed3d
WindowState to Maximized
ControlBox to False
MaximizeBox to False
MinimizeBox to False
ShowIcon to False
Text to an empty string
SkyWalker
|
|
|
|
|
|
is there any way to handle the unhandled exceptions generated to display user define messages instead of breaking the execution.
|
|
|
|
|
kalaveer wrote: handle the unhandled exceptions
Obviously not. The way to handle exceptions, is to handle them. You can handle all exceptions at a top level, but you can't then resume execution at the lower level where there were not handled.
I think you need to define your question better, but if you're hoping for a way to get the framework to ignore exceptions at the point they occur, without writing a try/catch, the answer is no. This is one reason that exceptions work better than error codes. They cannot be ignored.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi
i tried to display message box in C# library but i din't find the message.show instead of that mbox saying code snippet for message.show is there so how to use mbox in the library file to display messageboxes
thanks in advance.
|
|
|
|
|
You need to include the Windows.Forms ( from memory ) dll so you have access to the library. IT's just not going to be there by default, in a library project.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I came across the requirement for a project that I was working on, I have to add unlimited 'Adress(name address,city,zip)' to database when user clicks add button.
i have to delete the controls when he clicks delete button and have to reshuffle the the locations of other controls...
vidya K.A
|
|
|
|
|
You can add as many controls as you like to a form, just add them to the Controls collection.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Try creating a user control with the Address(name address,city,zip) info on it.
Then you add\delete the just the user control each time.
This way you only need to manage 1 control per address...
Cheers
|
|
|
|
|
Has anyone got any sample code for conway's game of life? Any help would be much apppeciated, thank you
|
|
|
|
|
Have you already looked here[^]?
Robert
|
|
|
|
|
How to get user`s login time?
I don`t mean the time when the machine has been turned on, just the time when user has logged to Windows.
|
|
|
|
|
This article might help:
http://weblogs.asp.net/ralfw/archive/2004/01/04/47442.aspx[^]
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks for effort but don`t you have some C# code?
|
|
|
|
|
-Yoyosh- wrote: Thanks for effort but don`t you have some C# code?
Good grief man. Do you want blood?
using System;
using System.Runtime.InteropServices;
using System.Collections;
namespace UserLastLogin
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
UserLoginDetails details = new UserLoginDetails();
ArrayList list = details.Users;
foreach (UserLastLogin.UserLoginDetails.UserLastLogon users in list)
{
Console.WriteLine("User {0}, last logged in on {1}\r\n", users.UserName, users.LastLogon);
}
Console.ReadLine();
}
}
public class UserLoginDetails
{
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct USER_INFO
{
public string Name;
public string Password;
public int PasswordAge;
public int Priv;
public string HomeDirectory;
public string Comment;
public int Flags;
public string ScriptPath;
public int AuthorisationFlags;
public string FullName;
public string UserComment;
public string Param;
public string Workstations;
public int LastLogon;
public int LastLogoff;
public int AccountExpires;
public int MaximumStorage;
public int UnitsPerWeek;
public byte LogonHours;
public int BadPasswordCount;
public int NumberOfLogons;
public string LogonServer;
public int CountryCode;
public int CodePage;
}
[DllImport("Netapi32.dll")]
extern static int NetUserEnum([MarshalAs(UnmanagedType.LPWStr)] string servername,
int level,
int filter,
out IntPtr bufptr,
int prefmaxlen,
out int entriesread,
out int totalentries,
out int resume_handle);
[DllImport("Netapi32.dll")]
extern static int NetApiBufferFree(IntPtr Buffer);
public class UserLastLogon
{
private string _userName;
private DateTime _lastLogon;
internal UserLastLogon(USER_INFO info)
{
_userName = info.Name;
_lastLogon = new DateTime(1970,1,1,0,0,0,0).AddSeconds(info.LastLogon);
}
public string UserName
{
get { return _userName ; }
}
public DateTime LastLogon
{
get { return _lastLogon ; }
}
}
private ArrayList _users = new ArrayList();
public UserLoginDetails()
{
IntPtr bufPtr = new IntPtr();
int entriesRead;
int totalEntries;
int resumeHandle;
try
{
NetUserEnum(null, 2, 2, out bufPtr, -1, out entriesRead, out totalEntries, out resumeHandle);
if (entriesRead > 0)
{
IntPtr iter = bufPtr;
for (int i = 0; i < entriesRead; i++)
{
_users.Add(new UserLastLogon((USER_INFO)Marshal.PtrToStructure(iter, typeof(USER_INFO))));
iter = new IntPtr(iter.ToInt32() + Marshal.SizeOf(typeof(USER_INFO)));
}
}
}
finally
{
NetApiBufferFree(bufPtr);
}
}
public ArrayList Users
{
get { return _users ; }
}
}
}
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Can you do my homework too?
|
|
|
|
|
ednrgc wrote: Can you do my homework too?
Sure - bring it on .
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|