|
Thak you,
I try this as following, but it doen't work
Public Class Form1
Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Control.CheckForIllegalCrossThreadCalls = False
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ind As Integer
Button1.Enabled = False
ProgressBar1.Step = 5000
ProgressBar1.Value = 0
Dim trd As Threading.Thread = New Threading.Thread(AddressOf ThreadDo)
trd.Start()
ListBox1.Items.Clear()
For ind = 0 To 5000
ListBox1.Items.Add(ind)
ListBox1.SelectedIndex = ind
Next
Button1.Enabled = True
End Sub
Private Sub ThreadDo()
ProgressBar1.PerformStep()
If ProgressBar1.Value >= ProgressBar1.Maximum Then
Timer1.Enabled = False
End If
End Sub
End Class
Eric H.
|
|
|
|
|
It seems to me that you should do some reading, and perhaps not worry about threads for a while until you've got a greater understanding of more basic things.
When asking a question, you should also define 'doesn't work', that doesn't tell us anything. Does it blow up ? Does it not do what yuo wanted ? Does it do anyting at all ? We don't know. Telling us the line that blows up and the error would also help.
And, what you're doing now is telling the framework not to protect you from yourself. This may work fine for such a simple app, but you'd do better to learn how to use a more powerful thread class ( BackgroundWorker ) and to ensure that your UI access is all in one thread. Then you can write *good* code, instead of just code that compiles.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You right, when I am saying doesn't work, it means in this case that first the listbox fullfilled and then the progressbar get to 100%. I don't see any thread working.
I am sorry my english is not mother tongue, I hope you understand
Thanks
Eric H.
|
|
|
|
|
Your code makes no sense at all - your progress bar is running in a different thread to the thing you're tracking progress on. The thread that's adding to the listbox, should be the thread that runs the progress bar, otherwise there's no relationship between the progress made and the state of the bar.
The code also calls a thread, outside of a loop, which will just step the progress bar once. And then it stops a timer, which we can't even see.
Overall, this code shows every sign of you're being well out of your depth with the concepts you are playing with, I'd recommend working through a decent book and trying to learn some basics.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If it is so easy for you to do this why don't you show me the solution like that I will be able to appropriate this easy example to my difficult application?
In my side, I will continue to learn VB.NET in my rythm.
Thank you
Eric H.
|
|
|
|
|
I just tried to run this code and it runs. Don't know what you trying to do though.
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
the listbox is fullfilled but the progressbar doesn't progress in parallel while the listbox is adding items.
First the listbox add items
second the progressbar =100%
Isn't it?
Thank you
Eric H.
|
|
|
|
|
I have finished my Project with no Errors, i try to Buld it, it will take time to Bring results and it will not Display my Results. it gives me an Errors saying"Just in Time Error" and it will Build
"
Preparing resources...
Updating references...
Performing main compilation...
"
for the Whole day. my sysytem is fast and i try to Google the Problem before i post.
Help
Vuyiswa
|
|
|
|
|
We really can't help, because you've posted no code and done nothing to explain what it's doing when yuo get this error
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Have you designed the component yourself or you are using any third party component.Make it Clear , as the error is of com+ component
please be clear of your problem you want to share.
thanks and wishes
Navneet Hegde
Nashik
Develop2Program & Program2Develop
|
|
|
|
|
Thank you i got the Solution, Just in time Debugger was not enabled
Thanks very much for your concern
Vuyiswa
|
|
|
|
|
Hello frnds,
Is there any code in vb.net to change the macro security to
"LOW"
i am using vb.net 2.0 and word2003
can i get the security options of a existing page ???
Means is it "Very High/High/Medium/Low"
please help...
Thankx to all and regards,
koolprasad2003
Life is swing with you..Enjoy..
|
|
|
|
|
If you would be able to change the macro security level programmatically, what would be the point of having macro security?
Although I am not sure, it seems entirely likely that the Microsoft people have hidden this setting from code, but if you can get to it, you should probably be looking at the properties of the application and not the document, as macro security level is set for the installation.
Now, more importantly, it sounds like you are trying to write a macro virus, otherwise there really is no reason to mess with macro security. If you really need some macro to work for legitimate reasons, you will have to inform the user in some other way that they should change the security level, for the document to be able to do what it is supposed to do, and preferably inform them of what the macro will do.
My advice is free, and you may get what you paid for.
|
|
|
|
|
can i add textboxes only in the first cell of datagridview?
I have four rows in the datagriddview.
I am using the following code
Private Sub dg1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dg1.CellClick
If (e.ColumnIndex = 2) Then
TextBox1.Visible = True
TextBox1.Left = 42
TextBox1.Top = 19 * (Me.dg1.CurrentCell.RowIndex + 1)
TextBox1.Height = dg1.CurrentRow.Cells(0).Size.Height
TextBox1.Width = dg1.CurrentRow.Cells(0).Size.Width
End If
End Sub
as the row index increases , the coordinates flaws increases.
|
|
|
|
|
This doesn't place a textbox in the cell. It moves an existing textbox OVER a cell in the datagrid. The offset flaw increases as the textbox moves down because your probably off by one pixel in one side of the multiplication to set the Top value. Instead of 19, try multiplying the row height of the currently selected cell.
Though, why are you hovering a TextBox over a cell in a datagrid anyway?
|
|
|
|
|
Hi, I have a word template document and I need to programming in Access VBA code to create a new word document based on the template that i have. Suppose that my template is locate c:\mytemplate\MyTemplate.dot . I also need to write some value into the specific line of word document. If anyone have a sample code please let me know.
Thank in advance!
|
|
|
|
|
Can anyone tell me how to add a custom dll control at runtime? I can add the control at runtime but the control is not seen on the form. I can add the control at design time and everything works fine.
|
|
|
|
|
maybe you miss this...
me.Controls.Add(yourControl)
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
i am using dotnet 2003.i am doing my project in vb.net windows application.i have two form in my project.first form is datagrid .In second form label and textboxes are avilable to save the entering values in datagrid of first form through this 2nd form.my problem is,if i select the row or record and click edit menu means,want to display the values of that selected row in textboxes of second form.
for example,
in first form,
there are 4 columns named as name,age,rollno,address in datagrid.
values are ramu for namecolumn,24 for age column,42 for rollno column,cbe for address column.now values in datagrid like below
name age rollno address
ramu 24 42 cbe
in 2nd form,there are 4 label and 4 textbox.textbox arenamed as nametextbox,agetextbox,rollnotextbox,addresstextbox.
my problem is,
in first form,
if i select the row(ie.,ramu,24,42,cbe) and i click edit menu means,i want to display the values automatically (ramu in nametextbox,24 in agetextbox,42 in rollnotextbox,cbe in addresstextbox)in 2nd form.
during runtime in vb.net windows application.so how i automatically display the values of row in each textbox.plz help me.
|
|
|
|
|
hi sathyan,
use following code at click event of edit menu
form2.nametextbox= Grid1.CurrentRow.Cells(0).Value.ToString
form2.agetextbox= Grid1.CurrentRow.Cells(1).Value.ToString
form2.rollnotextbox= Grid1.CurrentRow.Cells(2).Value.ToString
form2.addresstextbox= Grid1.CurrentRow.Cells(3).Value.ToString
form2.show
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
[img]http://i53.photobucket.com/albums/g56/marshmayllow/slidepuzzle.jpg[/img]
This' how the puzzle works. Quite sure everyone knows this game!
I'm a complete noob at this, and have not a slightest clue on how to start building the codes except that:
1. the buttons don't move (am i suppose to put the numbers under the 'text' property of the button?)
2. reseting it will give a new random arrangment
would be interested to know how to replace the numbers with images too..really thanks a million to whoever can help a poor soul here !
|
|
|
|
|
One has to ask why you're writing this, if you have no idea how to do it ? If it's homework, you should ask your teacher. If you're just trying to learn, I'd recommend trying something simpler first.
marshmayllow wrote: would be interested to know how to replace the numbers with images too
Buttons have an Image property.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i want to create a gridview like editable custom control which may have combobox in one or more then one column .
at the time of specifing datasource to custom control it should fill data in Comboxes also.
mahendra
|
|
|
|
|
Hi,
I am using a ToolStrip that doesn't use the (default) DockStyle.Top setting because I set its AnchorStyles (to Top, Left and Right), by which the Dock property is overruled. The reason for this is that multiple Toolstrips need to be shown below each other.
The problem is that the Overflow button on the Toolstrip doesn't appear anymore when needed. When I dont set the AnchorStyles property, the Overflow button appears, but then the ToolStrips ignore the Location I give them and appear in the wrong order because they all have DockStyle.Top again.
Thanks.
Jim
|
|
|
|
|
Gday,
Ok first question....go easy
Im trying to make the text in a label change according to what is chosen in a combo box. I dont get why this doesnt change the text in the lblRate. Would appreciate any advice?
Private Sub cmbPlanes_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbPlanes.SelectedIndexChanged<br />
<br />
Select Case Aircraft<br />
Case "Cessna 152"<br />
lblRate.Text = "$119"<br />
Case "Cessna 172"<br />
lblRate.Text = "$135"<br />
Case "Piper Cherokee"<br />
lblRate.Text = "$135"<br />
Case "Gazelle"<br />
lblRate.Text = "$85"<br />
Case "Gazelle"<br />
lblRate.Text = "$135"<br />
Case "Tecnam"<br />
lblRate.Text = "$110"<br />
Case "Beech Bonanza"<br />
lblRate.Text = "$289"<br />
Case Else<br />
lblRate.Text = "$0.00"<br />
End Select<br />
<br />
<br />
<br />
<br />
End Sub<br />
-- modified at 18:37 Saturday 2nd June, 2007
|
|
|
|