|
i know it is heard to do but its my job so tell me the book name or help me out
rishi dubey
|
|
|
|
|
There isn't one book name. There's a bunch of books, articles, and lots of practice involved in understanding how controls work. Search for anything on Windows Forms.
If this is your job, you're in trouble. Tackling a problem this big is not for a beginner, nor is it something for someone who cannot do their own research, because you're going to be doing LOTS of it.
|
|
|
|
|
i want to do bullet and numbering in my richtextbox help me out for example you can see msword the same thing i want to do pls help
|
|
|
|
|
There are several of those here on Code Project and a simple Google search turns up a couple of very nice ones.
Try looking for them and ask if you have specific questions.
The early bird who catches the worm works for someone who comes in late and owns the worm farm. -- Travis McGee
|
|
|
|
|
I search a lot but i did'nt got any answer if u have any link of the site pls send me on rishi_m_dubey@yahoo.com
|
|
|
|
|
i am a fresher in .net field. I have just started learning vb.net..
now i am trying to bind an arraylist to a datagrid. but i am getting a blank datagrid ...
here is my code...i dont know whats happening
this is the form_load event ....
private void Form1_Load(object sender, System.EventArgs e)
{
ArrayList aList = new ArrayList();
aList.Add(new Person("sayoni", 25));
aList.Add(new Person("fahim",28));
this.dataGrid1.DataSource=aList;
}
and the class is....
public class Person
{
String name;
int age;
public Person(String name, int age)
{
this.name=name;
this.age=age;
}
}
..can u find a problem here....?
|
|
|
|
|
A couple of them. First, you're in the wrong forum. This is the VB.NET forum and you posted C# code.
Second, in your Person class, you don't expose the name and age as public properties, so there's nothing for the DGV to bind to.
|
|
|
|
|
From the code you provided, it looks like you don't have any public properties. A class that is to be bound to a control must have property accessors. Any property that is to be bound must have Property Set and Property Get methods.
|
|
|
|
|
set a property for the name and the age..
and set them to the data grid display member and value member for each property.
be care the given property name must be qualify full case-s name..
Try
Dim SH*T as Mylife
Catch ex As Exception
msgbox("Im Happey Today")
End Try
|
|
|
|
|
i have a very basic problem and i dont know the reason for that..
suppose you have 3 forms
if in form2 u code :
form1.textbox1.text=textbox1.text
it works as at runtime value of textbox of form2 transfers into textbox of form1..
even in form 3 u code
form1.textbox1.text=textbox1.text
it works..
but if in form3 u code
form2.textbox1.text=textbox1.text
it doesnt works..
can anybody tell the reason..
and alternate method of doing the same..
thanks ...
|
|
|
|
|
You're breaking OOP encapsulation. The code on a form should be concerned with ONLY those controls on THAT form. It should not care about the controls of another form at all.
If a TextBox on a form needs to be modified, it can either subscribe to an event supplied by the object that might need to make changes, or it can pass a delegate to that object that the object can use to call a method on your form.
Having a form pass a reference of itself to another object so that object can modify the form's contents breaks encapsultation and permanently ties the object to that form. So much for reusability.
For instance, if I have a class that does some work and needs to report status information, it can expose an event that does this:
Public Class WorkerClass
Public Event ProgressReport(ByVal SomeValue As Integer, ByVal SomeMessage As String)
Public Sub DoSomeWork(blah, blah)
...
RaiseEvent ProcessReport(somenumber, "Some message...")
...
End Sub
End Class
In your Form1 code, you can create an instance of the class and wire up the events like this:
Dim myWorker As New WorkerClass
AddHandler myWorker.ProgressReport, AddressOf MyProgressHandler
.
.
.
Private Sub MyProgressHandler(ByVal SomeValue As Integer, ByVal SomeMessage As String)
' This is where you update your forms controls
End Sub
|
|
|
|
|
thanks dave,
now it makes sense to me.
as forms are classes so encapsulation concept will be voilated...
i'll try this way and come back to you..
thanks..
|
|
|
|
|
How do I make sure the user does not start more than on instance of my program? Can I do a test on the Load to see if an instance is already running? What would I test for?
|
|
|
|
|
one way to do this is on the load of you'r program check the running process
if you'r programme is already running there will be a processname very simular to you programme name
another way is to have a integer setting that gets incremented on the startup of you'r programme and decremented at the close of you're programme. then in the load you just check if that setting is 1 then go on else shutdown (you will need to increment the setting before you do this check and don't decrement it here otherwise you'll run in trouble)
another is to have a registry entry and check that (and clean it up when the programme closes)
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
Yeah, that's not a good idea since a crashed application can invalidate the count.
|
|
|
|
|
heum true
didn't think that far ahead
been a very long day but hey only half an hour to go ;P
PS: the first option would work even with crashed application (but might be a bit of a work around)
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
How would that code look like?
|
|
|
|
|
TDDragon wrote: PS: the first option would work even with crashed application (but might be a bit of a work around)
It is. Most people who use this technique will hard code the name of the .EXE in their code. What if the .EXE get's renamed by either the end-user or the guy writing the code??
|
|
|
|
|
Normal practice is to use a Mutex. Search the articles for "single instance[^]" for examples.
You application starts by checking for the existance of a known Mutex. If it doesn't exist, your code then creates the Mutex. At the termination of your app, you have to destroy the Mutex.
Now, when your second instance starts, the very same code checks for the existance of the Mutex. If it's there, your code could quit, or do whatever else you want.
|
|
|
|
|
If you are using VS2005, right click the project and click properties. On the application tab there is a checkbox that says 'Make single instance application'. If you check that then compile, it should solve your problems. If you are using VS2003 you will need to do what Dave said.
Mike Lasseter
|
|
|
|
|
Dear All,
When i executing my VB.NET project, an error message displays time to time as follows,
An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll
Additional information: Object reference not set to an instance of an object.
Always this is displaying at Public Class Form1
anybody can help me
Dimuthu
|
|
|
|
|
this means that you are using a variable before it has been initialized
for example
private sub blabla()
dim l as list(of string)
l.add("this is going to give a object referance not set to an instance of an object error")
end sub
solution:
private sub blabla()
dim l as NEW list(of string)
l.add("this is going to give a object referance not set to an instance of an object error")
end sub
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
Dear TDDragon,
Thanks, I checked all the variables, but they have all initialyzed. Stll the problem remaining.
Dimuthu
|
|
|
|
|
declare the form as NEW instance of the form class
then show it
as:
dim f as new (Form class)
f.Show
Try
Dim SH*T as Mylife
Catch ex As Exception
msgbox("Im Happey Today")
End Try
|
|
|
|
|
Dear all,
I know that this is not a new query. On the other hand I didn't manage to find a satisfactory answer.
So here I am.
I have a VB .NET application, which employs various CPU consuming algorithms.
I want to measure the execution time of a code snippet. Not the real time, but
the actual time that my code uses the CPU. Do be more accurate, I want to
have a CPU independent unit for comparison.
Apart the above question, is there any general platform independent method or unit to
characterize the execution speed of an application.
Than you all.
Konstantinos
|
|
|
|