|
Keep the subject brief and put the question in the body of the post.
Are you saying the a "PB" is a PictureBox control or a ProgessBar? Are you trying to make a custom ProgressBar with three different colors in the bar??
|
|
|
|
|
yes thats what I'm trying to do...
I think I should create a new class to inherit from ProgressBar then add my code, but really lost my mind thinking how to this.
will appreciate some suggestions.
thank you.
Shimi
|
|
|
|
|
You'd inherit from the existing ProgressBar class, add the appropriate properties to do what you want to do, then handle the Paint event and supply the new code to paint your ProgressBar control how you want it.
|
|
|
|
|
what a shame, I have never used the paint control, and don't even know what is it's features, and what purpose can it be helpful for.
if you have some examples to show me I'll be glad to see (I know only VB.NET).
thank you!
Shimi
|
|
|
|
|
Shimi
|
|
|
|
|
Yes! You can set BackColor property of a label to transparent.
|
|
|
|
|
I'm talking about System.Windows.Forms.Label
which doesn't react correct even I set the BackColor property at run-time.
my objective is to put a label within a picture or a drawn area so it must be really transparent.
thanks for your post.
Shimi
|
|
|
|
|
Hi
I have a very large file in whose format is like this:
KEYWORD
SomeInformationLines
KEYWORD
SomeInformationLines
I need to pass through the file and save the position of each keyword, so that when later, user wants me
to read the keyword data from the file, I can seek to the position of the keyword and read the data.
The problem is some files are unix format (i.e. their lines end with linefeed, Chr(10), only rather than CR-LF, Chr(13)+Chr(10)).
This is My Code:
FileOpen(1,FileName)
Do Until EOF(1)
strLine = LineInput(1)
If IsKeyword(strLine) Then
SaveKeywordPosition( strLine, Seek(1) )
' The above line is where the bug comes from:
' e.g if the line is empty, and only an LF is in it, Seek(1) returns 2!!
' i.e. it virtually adds a CR and this is done for all further lines too.
' But whem I use Seek(1, aPreviouslySavedPosition) it goes exactly to where
' it should go, without accounting for extra CRs which it added while reading
' the file.
End If
Loop
FileClose(1)
I also have tried to with InputString function, StreamReader and FileStream classes and check the last character of
the line manually, but the IO was raises from 800KB/s to 18MB/s and runtime from 15sec to 2min.
Could someone please tell me how should I handle this?!
|
|
|
|
|
MohammadAmiry wrote: I need to pass through the file and save the position of each keyword, so that when later, user wants me
to read the keyword data from the file, I can seek to the position of the keyword and read the data.
OK. If you're using ReadLine to read the file, you won't get the LF character at the end of each line in the resulting string. ReadLine will strip the line termination characters for you. So, you simply have to add one to the character count of each line you read when you go to find each keyword.
If you have a mix of file types, then you'll have to find out what the line termination characters are. Simply read the beginning of the file, character-by-character until you find either character 10 or 13, then check value of the next character to see if it is the opposite, 13 or 10, or if neither. This will tell you if the line termination is either CrLf, LfCr, or just Cr or Lf. You can adjust your character count accordingly.
|
|
|
|
|
hi,
i create the arrary of button called (gButton(55) As Button) and in run time it stop in this error "gButton(count).Name = "R" + CStr(count)"
and error is "object refrence not set intance of object"
how can create array of button and set it the name of button ?
|
|
|
|
|
You declared an array of buttons, but the buttons are not instantiated. You need to instantiate them.
By the way, why so many buttons?
|
|
|
|
|
darkelv wrote: You declared an array of buttons, but the buttons are not instantiated. You need to instantiate them.
So in other words use the keyword "New" to instanciate it.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
to collocet my button in form to process them in queue
|
|
|
|
|
Merry Christmas to everyone!
Don't you know how I can get the image my form looks like?
I've tried DrawToBitmap method, but with that I didn't get the graphics, just the controls.
Please help if you can.
|
|
|
|
|
What is it you are trying to do? Put a picture on the form or as a background for the form?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Sorry I didn't write clearly, my problem is the following:
I've a form, and controls in it. I want to get the same image that the user sees on the screen. If I don't use graphics, I can use DrawToBitmap method. But what should I do if I use graphics too???
|
|
|
|
|
Hi,
if you do the graphics correctly, you will catch it. Here is a tiny paint instruction:
there are several steps to draw something so it becomes visible on the screen:
1.
decide upon what object you want to draw; it normally is a Control (e.g. a Panel) or a
Form itself. I prefer to add a Panel to a Form, then draw on the Panel.
2.
create some variables (Rectangle, struct, class, whatever) that hold the parameters of
your drawing. For a rectangle that could be top and left coordinate, and width+height,
or just a Rectangle. etc.
3.
create a Paint handler for that Panel, and do all your drawing in there, using the
Graphics class and your variables.
4.
when you want to change things, modify the variables and call Panel.Invalidate() or
one of its overloads (for selective invalidation).
5.
If you want to animate things, perform the move (step 4) inside the Tick handler
of a Windows.Forms.Timer
BTW: if you need to create some objects (Fonts, Pens, Brushes, ...) either keep them
alive in class members (hence create them only once); or create them inside the Paint
handler and don't forget to call Dispose() on them.
|
|
|
|
|
Hi,
I want to serialize a control.
I could not Serialize control datatype but I have created a Serializable() class that has a property that holds my control and I tried to Serialize object of that class but still not working.
Here is source.
<Serializable()> Private Class Slide_Master
Dim _Main_Panel As Object
Public Property Main_Panel() As Object
Get
Return _Main_Panel
End Get
Set(ByVal value As Object)
_Main_Panel = value
End Set
End Property
End Class
'Serializable class
'Code for writing in file
Dim sm As New Slide_Master
sm.Main_Panel = CType(pnlMain, Object)
Dim str As IO.Stream = IO.File.OpenWrite(Application.StartupPath + "\chl.dat")
Dim formatter As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
formatter.Serialize(str, sm)
str.Close()
Help me out
|
|
|
|
|
control class is doesnt have Serializable attribute. so you cant serialiaze i guess. is anyone know other method?
Manikandan.net
[Coding is life]
|
|
|
|
|
please, help me.
i want to add component control: mySQL VB API v2.0.0 in VB6.
But, mySQL VB API is not listed on component control.
How to make it listed?
I've register myVBQL.dll, and could not be loaded...
Please... help me...
|
|
|
|
|
I haven't used VB6 in so long... Try right-clicking the ToolBox, there should be something like "Add/Remove Item". Click it. A dialog should open up and you can find the MySql components, if they're exposed as such...
|
|
|
|
|
Hi
I am not using VB for some time now i do not remember exact menu option but may be the input will give u some idea..
go to project menu u have add component something like that.. There it lets u browse and select the dll to be added
Good luck
|
|
|
|
|
Hello every one
I am having a VB.net 2005 Express application.. I was having some issues with database connection and the way I was handling the errors
Now with some input I am using try and catch… Following is what I want to do
Execute Query
If any DB connection Error Display Retry Msgbox
If retry clicked then close the connection and open it again
If no error the execute the query If error for three times then close the application
Can any one plz help me to put these steps in nested Try and Catch
|
|
|
|
|
Try this concept..
<br />
Public Function YourFunction() as Boolean<br />
Try<br />
If ConnIsOpened then Close<br />
OpenConnection<br />
Execute SQL<br />
CloseConnection <br />
Catch ex as Exception <br />
If(Messagebox.Show("There is some errors, Do you wanna try again?",,,YesNoButton) = YesButton) then<br />
YourFunction()<br />
End If <br />
End Try<br />
End Function
|
|
|
|
|
how to add dynamically the usercontrol's to the page when ever the button click then only add the webusercontrol's to the page
|
|
|
|