|
|
You are not quite provide sufficient information for an answer.
For example, if you are using a Windows Form application, then are you using the PrintDialog control?? That gives you access to the printers and allows the user to define printing landscape.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
i am using Windows Forms application.
But i am printing a Crystal report from Crystal Viewer using its default toolbar button.
I set landscape orientation in Printing Options for the report. So, it is PRESENTED in landscape. But, when it is printed, its printed in default printer orientation.
So I need a way to change default orientation, print report, then change it back.
Sounds like "left hand to right ear", but can't see any other way.
|
|
|
|
|
I have a datagrid showing 200+ records, if user scrolls down to select a row that is off the initail screen, can I set the datagrid to show that part of data around the selected row to avoid user using scroll bar again and again.
Thanks,
|
|
|
|
|
If I understood well, you want to be able to scroll the DataGrid to a certain position.
DataGrid has some protected members that you can use to handle scrolling: VertScrollBar, HorizScrollBar, GridVScrolled, GridHScrolled.
For vertical scrolling I recommend you to do something like this:
public class MyDataGrid:DataGrid
{
public void ScrollToPos(int position)
{
ScrollEventArgs sea= new crollEventArgs(ScrollEventType.ThumbPosition,position);
this.GridVScrolled(this,sea);
}
}
Best Regards,
Daniel Zaharia
|
|
|
|
|
Thanks a lot, your method is working fine. I just put the row index as the position parameter.
Appreciate!!!
|
|
|
|
|
Do any know how to impliment adding a computer to domain using C#. I know you have to import System.Directory.Services.dll Can you please help
thanks
CJ![Smile | :)](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
Try something like the following:
string domain = ...;
string newComputer = ...;
string groupName = ...;
DirectoryEntry deDomain = new DirectoryEntry("WinNT://" + domain);
DirectoryEntry deNewComputer = new DirectoryEntry("WinNT://" + domain + "/" + newComputer + ", computer");
DirectoryEntry deGrp = deDomain.Children.Find(groupName, "Group");
if (deGrp.Name != null)
deGrp.Invoke("Add", new Object[]{deNewComputer.Path.ToString()});
deGrp.CommitChanges();
|
|
|
|
|
Thanks so much![Big Grin | :-D](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_biggrin.gif)
|
|
|
|
|
I'm starting an application with windows Forms. I know how change the current Culture and since this action every resouces that open, take the new Culture Value( System.Threading.CurrentThread.CurrentUICulture = new Globalization.CultureInfo (String * IdCulture) (...) )
OK that's right, but what happens with the Main Form that is Loaded since the start of execution?
Can I do a Reload or something like that, by anyway, or assing dinamically another ResX File to the MainForm for translate it without Close()?
Advanced thanks, gurus. I expect your answers
|
|
|
|
|
Instead of putting this code in the constructor or something else that initializes controls (default for forms designers), put it in a separate method that re-instantiates the ResourceManager and assigns the localized strings / objects to the respective control properties.
You can also create a ResourceManager for a specific culture rather than setting the current thread's UI culture, but this usually a good idea to do anyway.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I'm starting an application with windows Forms. I know how change the current Culture and since this action every resouces that open, take the new Culture Value( System.Threading.CurrentThread.CurrentUICulture = new Globalization.CultureInfo (String * IdCulture) (...) )
OK that's right, but what happens with the Main Form that is Loaded since the start of execution?
Can I do a Reload or something like that, by anyway, or assing dinamically another ResX File to the MainForm for translate it without Close()?
Advanced thanks, gurus. I expect your answers
|
|
|
|
|
I have some code
hehehe
How can I use Explorer control to display it? And how can I add some images in this control in run-time?
Thank u very much ![Rose | [Rose]](https://codeproject.freetls.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
1) Create a new C# Windows application
2) Go in the Toolbox, right-click, add a new item. Choose the "COM components" tab, and select the "Microsoft web browser" (shdocvw.dll)
3) drop the web browser onto the form
4) select the web browser control
5) show the Properties window, click on the laser icon to show all events
6) in front of NavigateComplete, add an event handler, for instance : OnNavigateComplete.
7) go back in the solution tree, right-click and add a reference, browse then choose "Microsoft HTML document" (mshtml.dll)
8) open the C# code
9) add the #using mshtml; statement at the top
10) in InitializeComponent(), add the following code :
object o = null;
Show();
axWebBrowser1.Navigate("about:blank", ref o, ref o, ref o, ref o);
Then, implement your event handler like this :
private void OnNavigateComplete(object sender, AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event e)
{
IHTMLDocument2 doc = (IHTMLDocument2) this.axWebBrowser1.Document;
doc.body.innerHTML = @"<img src='http://www.arstdesign.com/iconpdf.gif' border=0>";
}
As you can see, the event handler is only here to temporize before the Internet Explorer instance is up and ready. Once it is, we add the html code to render with a simple doc.body.innerHTML statement.
Good luck!
RSS feed
|
|
|
|
|
Thank u very much for your attention. Your help is very userful for me.![Rose | [Rose]](https://codeproject.freetls.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
include icon of the file-type, application that will be invoked when user run that file-type.
thanks.
|
|
|
|
|
|
|
I'm looking for book recomendations for developing against Active Directory with C#.
I've gone through the DirectoryServices namespace documentation in the MSDN library, but it falls short in covering the directory entry properties, etc... or I just haven't been looking in the right place.
Any good books or web references would be appreciated.
Thanks,
Jim
|
|
|
|
|
Hi, I have been trying to look in the msdn library, but found nothing, maybe because i dont know what i am looking for. If you know how to obtain a list of computers in a domain, it would be helpful if you told me, or told me where to look.
Thanks
|
|
|
|
|
In most cases, you can P/Invoke NetServerEnum in the Network Management API. There's no native way in .NET. You could possibly, however, use classes in the System.Management namespace to query WMI if you have an AD WMI provider. I can't remember off the top of my head if one comes with NT by default or now, or if it even exists. That's really about the only way without P/Invoking anything.
You can also use a slew of AD functions, but that will include P/Invoke functions and redefining structs and constants when needed.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Did you check out the System.DirectoryServices.DirectorySearcher class? Looks like it uses ADSI to do its dirty work. Good luck.
Thank you.
Jeff Varszegi
|
|
|
|
|
How can I make so happen? and how can I contact the "popserver" through my code?
please help...
Sashy
|
|
|
|
|
Check this control out http://www.codeproject.com/internet/cpop3conn.asp?target=email#Retrieve
You might also want to search a bit more on codeproject, as there are lots of pop3 apps.
|
|
|
|
|
Well i am not an very experienced programmer i think i might need to take a look at an application using this. And can I use those principals specified in the artical???..cause I´m not working on a .NET application, but an Windows appl?
thanks for your response! ![Smile | :)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|