|
Printing in .NET is not that much tough as i know. Please refer this article to get to know about more.
Printing in C#
Sreejith Nair
[ My Articles ]
|
|
|
|
|
I need to read up on the implication of server farm AND database clustering on COM+ transaction. Any reference? Preferably URL's so I don't need to rush off to the bookstore.
Thanks in advance.
Norman Fung
|
|
|
|
|
I'n new to programming and I'm writing a simple app where I generate a 2 digit random number in one textbox. When I click a button, I want the value of that textbox to appear inside another textbox.
After playing with this for hours (and learning along the way), I'm getting nowhere.... The closest I've come is this;
textBox1a.Text = (textBox1.ToString());
The text is entered into the text box as follows:
System.Windows.Forms.TextBox, Text: xx (where xx is the random #)
I don't want this - I just want the random number in place and not the whole string.
Any suggestions?
Thanks,
Mike
|
|
|
|
|
I recommand you to study or refer few C# programming books. MSDN is a nice guide for newbee like you. Better don't get into Visual Studio.NET IDE untile and unless you know little about how to use .NET laguages.
Here is the solution for your issue.
textBox1a.Text = (textBox1.Text.ToString());
Sreejith Nair
[ My Articles ]
|
|
|
|
|
sreejith ss nair wrote:
MSDN is a nice guide for newbee like you.
MSDN has a lot of useful information for anyone programming with Microsoft technologies. (I'll assume the condescending tone was unintentional.)
sreejith ss nair wrote:
Better don't get into Visual Studio.NET IDE untile and unless you know little about how to use .NET laguages.
I think that is bad advice. Read all you can, yes, but do it in addition to coding, not instead of it.
Charlie
if(!curlies){ return; }
|
|
|
|
|
sreejith ss nair wrote:
textBox1a.Text = (textBox1.Text.ToString());
Why, again, are you using .ToString() on a string???
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
There are no default properties in C#, so you'll need to specifically state what property of textBox1 you're trying to get at, which, in this case, is the Text property.
textBox1a.Text = textBox1.Text; The compiler can't infer what you meant because you could have just as easily wanted to display textBox1 's Name , BackColor , or PasswordChar , etc., in textBox1a .
Charlie
if(!curlies){ return; }
|
|
|
|
|
Thanks for the help. The first reply solved my problem. I agree that I should be reading AND doing to learn the mosr efficient way. Thanks Charlie!
I have another ? that I'll post in a new thread.
Mike
|
|
|
|
|
Any suggested reading on Class's, Inheritance and class accessbility with C#?.. I'm getting my feet wet with ClassLibraries and been finding nothing but too abstract examples from .NET's help.. want to protect what can be instantiated w/out nesting class's.. trying to funnel creation thru single class. I'm sure its the bee's and not the bears in this neck of the woods but if anybody's found any good examples plz let me know..
aspiringCodeMonkey says ...
|
|
|
|
|
You Wrote : Any suggested reading on Class's, Inheritance and class accessbility with C#?
In .NET we have different class types. Say Abstract class, Selaled class , Concreate Class , Singleton class etc.
In .NET we have classical(is a) inheritance and containmnet(has a).
In .NET we have different type of access modifiers. Say Public,private,Protected,Internal,Internal Protected.
So it is very tough to explain entire concept in a small paragraph. And also it is very tough to see your requirement in one article (consolidated). So what i suggest you is search and find few article related to above mentioned keywords.
This will also help you to learn about Class Libraries
Getting Started With Class Lib
Sreejith Nair
[ My Articles ]
|
|
|
|
|
The immediate answer to your problem is to specify any classes that you only want visible within the class library as 'internal', and have one 'public' class, which is accessible to anything referencing your library. However, internal classes are completely invisible outside the class library.
Another trick is to make a class public, but make all its constructors internal, so it can only be created by other classes in the same library, but can then used by any code anywhere.
Hope that helps,
Andrew
|
|
|
|
|
How can I divide Application to FRAMES so that I can display Forms to these Frames ?
Who know please help me.
Thanks alot
change global
|
|
|
|
|
Search MSDN for the documentation for the Splitter class. It allows you to divide a form into frames.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I have a control that includes a few buttons, a drop down and a text box.
There is a property called DestinationGrid which is set at design time to be the grid the control works with. I also have another property called SelectedRow which is used to set the on the grid. Because the grid doesnt have any rows I get an error when I view the form at design time saying that SelectedRow - Object not set to an instance ...
How can I stop thsi error occuring?
I could remove the property and use a SetSelectedRow() and GetSelectedRow() method, but would like to use a property.
Any suggestions? Thanks
|
|
|
|
|
Write a intialiser in your custom class constructor. That means, in your custom control constructor you have to initalise the selected row value if the datagrid is selectable. To check whether datagrid is selectable use this dataGrid1.CanSelect property . If it is selectable then it will return true else will return false.
This is only a small idea to handle the situation.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
Here is my problem. I have a vb.net form that is an FTP client, It calls a C# class for when it downloads a file. while the file is being downloaded it is in a loop in the C# class.
Info on the vb.net form dosnt get updated until the download finishes and C# class exits the loop.
how do I make the C# class update the form with download stats while sill in the loop? I need this to be able to show download speed and progress.
|
|
|
|
|
Why don't you create a thread from which you call the C# class.
Then Loop while waiting for the thread to complete, and update the form while in the loop?
Pauwll
|
|
|
|
|
how would i do that?
right now its somthing like this.
progress1.progress = 0
ftp.Download(filename)
statusbar.panels(0).text = "Done Downloading"
once it gets to the download line it starts donwloading and the program seems like its frozen until the download finishes, then it continues like normal.
|
|
|
|
|
This is because your Userinterface and Download are in the same thread, as mentioned before. A thread is linear, meaning in order to execute order 3, you need to do 1 and 2 first.
This means, if you have a thread which loops from 1 to 10 and prints, the result will be:
1
2
3
4
5
6
7
8
9
10
Your program is busy with the Download code, so it cannot execute the UI-code at the same time.
What you need to read about is "multithreading", e.g. have your computer do several things at the same time.
If you had 2 threads looping from 1 to 10, you could get:
1
1
2
3
2
4
3
5
4
5
6
6
7
7
8
9
8
10
9
10
This is because Windows decides which thread gets to execute at any time, but tries to divide processing time evenly among threads (this changes if you start messing with priorities).
Fire up MSDN (online or local) and read up on the System.Threading namespace.
If you have a static method you want to run in its own thread, just
create a new thread (Thread oThread = new Thread(new ThreadStart(myStaticMethod));) and then start this thread (oThread.Start();).
It will automatically stop after it has completed its work.
You could also use QueueUserWorkItem if you want Windows to take care of creating and starting your thread, or you could use asynchronous methods for your FTPing.
Cheers
Sebs
|
|
|
|
|
OK i got the threading figured out.
now i got the download rining in its own thread, The program is responsive while its downloading and the animations move on the form.
but i still have the same problem. how do i get the download status from the class in the new thread?
is there some way of sending info from a C# class to a vb form?
for example, have the class update a label on the form with amount downloaded so far.
|
|
|
|
|
hi !
How can I open excel file, show it on DataGrid, then save it into Database(SQLServer) ???
|
|
|
|
|
You can have a look into the COM component "Microsoft Excel 11.0 Object Library" which is avilable in IDE COM tab once you have office installed in your machine. This class will expose lot of operations which we can deal with excel files. please find MSDN for more info and code samples.
Please read this article too Working With excel
Sreejith Nair
[ My Articles ]
|
|
|
|
|
I create a user control object and show its properties through a propertygrid
object in my application. It is sure that there are 100 hundred of properties
inherited from System.Windows.Forms.UserControl and they are all showed on
the propertygrid. Is there a way i can hide all these inherited properties
and show only my user control's properties ?
|
|
|
|
|
Override the properties you want to hide (calling the base class where appropriate) and add the following attribute:
[Browsable(false)]
Note that this will only hide the property from the visual form editor, it will still appear on the Intelissense and anyone will still be able to use it.
Yes, even I am blogging now!
|
|
|
|
|
Is that the only way i can do? because I have 10 - 20 user controls and i need to hide all of inherited properties. This would be a huge task !!!! T_T
|
|
|
|