|
eviljohan wrote: Is that I'm doing a projet, and I want to include a ProgressBar in the Splashscreen. Is that possible?
Yes
eviljohan wrote: I want it to be a load progress bar
To load what? You haven't explained what you want to do.
I suggest you read the documentation on the ProgressBar[^] control and follow up your post if you have a more specific question.
Paul Marfleet
|
|
|
|
|
Hi Pmarfleet
I don't want to show exactly the progress of something, is that I want the progress bar there to be like a decoration. You know like when you start your computer and it says Windows XP, you know there is a progress bar with the blocks passing by, I want my progress bar to be like the one when windows is starting up. I hope you understand.
Thanks, I hope is clear now.
|
|
|
|
|
What are you showing the progress of??
All too often this question comes up and the poster thinks that the progressbar just magically knows what it's showing the status of. You're code has to increment the progressbar every once in a while. So, what is it that you want to show the progress of??
|
|
|
|
|
Hi Dave:
I don't want to show exactly the progress of something, is that I want the progress bar there to be like a decoration. You know like when you start your computer and it says Windows XP, you know there is a progress bar with the blocks passing by, I want my progress bar to be like the one when windows is starting up. I hope you understand.
Thank you very much and sorry for the misunderstanding, is that I'm just a newbie on this. I'm taking my frist class right now of Visual.
|
|
|
|
|
If I understand correctly you are showing a Splash Screen for a certain interval of time, and while splash screen is on screen you want to have a Progress Bar which will increment and show how much time has elapsed.
If this is what you are doing then you may have code like this-
---------------Code Start--------------------
On Form load set maximum and minimum value for Progress Bar, here I am using a timer which will show splash screen for 5 seconds, following lines will go in Form load event of SplashScreen –
Me.Timer1.Enabled = True
Me.Timer1.Interval = 1000
Me.ProgressBar1.Maximum = 5
Me.ProgressBar1.Minimum = 0
Now timer will run following code after every second and will also Increment the Progress Bar-
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
i += 1 'i is a Form level variable
If i = 5 Then
Me.Hide()
Else
Me.ProgressBar1.Increment(1)
End If
--------------------Code End---------------
I hope this helps .
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Hi Dave:
You are almost correct my friend. I just did a copy & paste from this code you send me but it says that Name "i" is not declared. Ok I want the progress bar to be as the one when windows XP starts you know that it doesn't point the progress of windows starting, it is just there with the blocks passing by, that's want I want to do. My apologies for asking so much is that I'm a newbie working with Visual. Could you help me out.
Thanks
-- modified at 18:59 Wednesday 10th October, 2007
|
|
|
|
|
Then change the ProgressBar.Style property to Marquee and set the MarqueeAnimationSpeed to some value, like 250 milliseonds.
|
|
|
|
|
How to make a ruler in richtextbox in vb.net for eg:- see msword
|
|
|
|
|
This is a VERY complicated topic, so I'll ask a simple question first.
Do you know how to write your own custom controls, from scratch?? That means you MUST understand completely how controls work and can write one from the ground up, providing all the properties, logic, rendering code, events, methods, ... So, do you??
|
|
|
|
|
No i don't know how to write custom control if u have any link pls send me and also help me about ruler thanks for reply
|
|
|
|
|
No, there isn'tone link that will tel you how to do this. Dozens of them, maybe. An entire book on creating controls and how they work, maybe. But this is most certainly NOT something for a beginner to tackle, nor is it going to be covered in a couple of articles.
|
|
|
|
|
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.
|
|
|
|