|
Having considerable problems in storing and retreiving data from an Access memo field into a windows form richtext control. Have seached the web for a simple answer and so far haven't fount anything. Anyone have any insight to this problem? All help appreciated.
Thanks...
|
|
|
|
|
Is the memo field storing plain text? html-formatted text? rtf-formatted text?
|
|
|
|
|
Hi Mike,
I'm using richtext. I'm sure there's a way since I've done this in Delphi. I'm new to C# and just can't seem to figure it out.
Thanks,
Bob
|
|
|
|
|
Hi NG,
how can i browse the WMI Class schema on my local maschine. I would like to fill a tree view with WMI class types registered on my local machine.
i used the following code to get the namespaces:
ManagementClass nsClass = new ManagementClass(
parentNode.ManagementScope,
new ManagementPath("__namespace"),
null );
foreach(ManagementObject ns in nsClass.GetInstances()){}
the fetched namespaces are ok, but if i try to fetch the class types with
ManagementObjectSearcher searcher = new ManagementObjectSearcher(
parentNode.ManagementObject.Scope,
new WqlObjectQuery("select * from meta_class"),
null);
foreach (ManagementClass wmiClass in searcher.Get()){}
there are only __XXXX class types, the Win32_LogicalDisk for instance is missing. Seems like i read the wrong data
Any Idea what it needs to show the display names for each class like Win32_LogicalDisk etc.?
.:[Greetz from Jerry Maguire]:.
|
|
|
|
|
Jerry,
If I understand your question correctly, the code below will grab the class names for a given namespace. Note the use of the "deep" option to force a traversal of all the classes in the namespace, not just the top-level ones. Hope this helps.
Jerry
ManagementPath nsPath = new ManagementPath();
nsPath.NamespacePath = <whatever namespace="" you="" want="">;
ManagementClass nsMgmtClass = new ManagementClass(nsPath);
System.Management.EnumerationOptions enumOpts = new EnumerationOptions();
enumOpts.EnumerateDeep = true;
string clsName = "";
foreach (ManagementObject obj in nsMgmtClass.GetSubclasses(enumOpts)) {
clsName = obj.ToString();
CbxClassName.Items.Add(clsName);
}
|
|
|
|
|
Hi NG,
i try to load and save some configuration data at startup/shutdown in my vs.net 2003 addin.
But i can't create a IsolatedStorageFileStream. The exception message is
{"Unable to determine identity of assembly." }
If i run the UserControl which is nested in a ToolWindow standalone everything works fine.
Any Idea?
.:[Greetz from Jerry Maguire]:.
|
|
|
|
|
I am building a multi-threaded application with numerous amount of threads ---- The thing is for each thread it has to be a random name and I do not know howto to create and start random named threads ----
help is greatly appreciated Thanks
|
|
|
|
|
Threads = headache
Random threads = insane!
Theortically you could create a hashmap or similar, create a random string value for the key and an instance of the thread for the value.
That way you would have random names associated with the threads, plus you could still enumerate through the collection. Plus the collection could grow and shrink as necessary.
But please... dont
/**********************************
Paul Evans, Dorset, UK.
Personal Homepage "EnjoySoftware" @
http://www.enjoysoftware.co.uk/
**********************************/
|
|
|
|
|
Can one change printer orientation to landscape, using c# and no API?
I can't even get hands to default printer.
tia
|
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
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.
|
|
|
|