|
Is there a way to have the CommonDialog control return a path and not a filename?
Thanks,
Tim
|
|
|
|
|
|
The Folder Browser dialog is typically used if the user needs to select a folder only.
|
|
|
|
|
|
Commondialog1.initdir="C:\windows\system"
|
|
|
|
|
After a ComboBox_SelectedIndexChanged event, my application is taking over the CPU and using it to 100% and will not release it. I have step over every line of code and did not detect any infinite loops or what so ever.
Every line within the subs and functions that are used seem to be serving their purpose. The application continues running without any "trouble", I am able to go from one Dialog to the next one and back; execute every single piece of code within the project without errors, but the CPU will not stop running at 100%.
The controls involved are two Grids from C1.Componets, a standard ComboBox and the variables needed to keep track of the number of rows I am inserting given certain parameters each one declared within the subs or functions that use them.
Does this make sense to anybody? Any sugestoins on how to aproach the issue?
Thank you very much for your priceless help.
Alex (completely lost rookie)
|
|
|
|
|
alexvw wrote: After a ComboBox_SelectedIndexChanged event, my application is taking over the CPU and using it to 100% and will not release it
Almost certainly, the event handler is setting the selected index, which raises the event, which causes the index to be set, which.....
Either way, posting the code is the only way anyone can offer specific advice, as opposed to the guess I just offered you.
alexvw wrote: The application continues running without any "trouble", I am able to go from one Dialog to the next one and back; execute every single piece of code within the project without errors, but the CPU will not stop running at 100%.
That's odd then, I'd expect a non-responsive UI. Can you post the code ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks a lot for your interest in my problem. I found out that my application behaves in such a way only when I am running it in Debug-Mode. I built the release version of it and it works without messing with the CPU at all.
Once again, thank you very much for your help.
Alex.
|
|
|
|
|
Alex, I'd be suspicious of the SelectedIndexChanged event handler code since the CPU seems to peg after that event is fired.
Are you sure that the event handler does not create an infinite loop or sets (or resets) some variable that may cause repeated executions of the event? How is the combobox being populated? Is it manually or via some data control? Without inspecting your code it can be hard to provide any clear cut answer.
Have a look at Task Manager to see whether or not it is VB or some other process that is consuming the CPU. That may give you some clues.
...Steve
|
|
|
|
|
Thanks a lot for your interest in my problem. I found out that my application behaves in such a way only when I am running it in Debug-Mode. I built the release version of it and it works without messing with the CPU at all.
Once again, thank you very much for your help.
Alex.
|
|
|
|
|
I am new to .NET please help me out to start it
|
|
|
|
|
I don't think you could have asked a more generic question. You're going to have to specify what you want help with. Start what? The IDE (development environment)? Creating a project or application? What type of application, Windows Forms, Windows Service, Web Service, Class Library, or Web App? Or starting out learning VB.NET perhaps?
The quality of any answer to your question lies in the details of the question itself...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
First, install the IDE. Then, read the MSDN that came with it. Then buy a book/download some of the samples and play with them. If at any point you get stuck, ask specific questions here.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
johnalwaysweb wrote: I am new to .NET please help me out to start it
public void Main()
{
delete Microsoft.VisualBasic;
return 0;
}
Pumk1nh3ad illustrates that Intelligent Design oft goes awry. - Ed Gadziemski
|
|
|
|
|
I am using Printer.Print method to print some strings. The printer does not start printing until Printer.EndDoc method is not called. Why?
Another problem, I want to stop paper after printing some line until I order to move forward.
When I call Printer.EndDoc , printer starts printing and then eject all the remaining paper.
I want to use printer for billing on 3 inch paper strip with unspecified length.
Pleae solve my problem.
Thanks for you inclination to my problem.
Shoaib Nawaz
|
|
|
|
|
hellow ..
i have an updatedatagrid function how can i use it in other forum that dose not have the datagrid it self ?
|
|
|
|
|
I have a search page with 3 textboxes. I want to do a search on any text that may be in the text boxes. Let's say we have box1, box2, and box3. I want to do a search as follows:
If box1 <> "" Then
do this...
ElseIf box2 <>"" then
do this..
ElseIF box3 <> "" Then
Do this...
Else
do this ...
Does anyone know how to do this using CASE statement?
macca
|
|
|
|
|
Hi there,
Instead of using the two else statement in the if block i would rather use one as follows
If box1= "" and box2="" and box3="" then
SQL= no query or no search
else
' this indicates at least one box has the a text
'then SQl query can be as follows
SQl = "Select * from Table where ColumnA=box1.text or ColumnA=box2.text or columnA=box3.text
end if
I hope this helps
Mandar Patankar
Microsoft Certified professional
|
|
|
|
|
Hi All,
Point function of Form object returns color of the pixel at a
partcular location on the form.
I tried to use this function in a project of Graphics.
I found that the behaviour of the function was strange.
Sometimes, the function returned a color value upon clicking
a pixel on form.
Other times, it simply falied to return anything.
It just kept returning -1 eventhought the color of the pixel was red.
The same code worked on other PCs while on still others it failed.
Can anyone explain why Point function behaves like this ?
I need a quick reply.
Thank you.
Varun
|
|
|
|
|
Hi!
I wanna send a value to a field on a site, i m using AxWebBroeser Control in vb.net, i 've displayed the page in the control..how can i do this...plz help me
Thanks!
Sufyan
|
|
|
|
|
You need to obtain a reference to the control to which you want to send the value and then set it. The trick is to get the Name of the control to obtain the reference. For this you can inspect the source code for the target page.
This is some sample code that loads the Google web site in an AxWebBrowser control, sets the search value to "axwebbrowser" and auto-presses the Search button. I based this example on one I found on the web somehere a while ago.
Assuming the web browser control is named web1, navigate to the web site in your Sub Main() (or whatever).
web1.Navigate("http://www.google.com")
In web1's DocumentComplete event:
Private Sub web1_DocumentComplete(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent) Handles web1.DocumentComplete
' Get the web document
Dim myDoc As mshtml.HTMLDocument
myDoc = DirectCast(web1.Document, mshtml.HTMLDocument)
' Get the reference to the search text input box.
' The name of this control is "q" which I found from
' inspecting the page's source code.
Dim otxtSearchBox As mshtml.HTMLInputElement
otxtSearchBox = DirectCast(myDoc.all.item("q", 0), mshtml.HTMLInputElement)
' Set the search value to "axwebbrowser"
otxtSearchBox.value = "axwebbrowser"
' Get a reference to the search button and simulate
' pressing it by calling the control's Click() event.
Dim btnSearch As mshtml.HTMLInputElement
btnSearch = DirectCast(myDoc.all.item("btnG", 0), mshtml.HTMLInputElement)
btnSearch.click()
' The web control will now update and presnet the search results.
End Sub
...Steve
|
|
|
|
|
:-DHi Steve!
your tip was indeed very help ful for me thanks!!!
i 'll looking forward for any future help from u
thanks aloooot!!!
Sufyan_shani
|
|
|
|
|
Hi,
I have just completed making my user control for the VB.NET studio,which I have built as a DLL file. Now, when it comes to setting up the deployment project, I am unable to determine the appropriate location to install the DLL file so that another VB.NET programmer can easily access this file and make use of the control.
Thanks in advance!
|
|
|
|
|
Could someone helpe me,please.
I want to make two buttons in my form ,one search the DB by the patient_no and the other by the patient_name.
I did one button search by the patient_No and it worked, but the other didn't What should I do?
this is part from my code:
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click<br />
DataSet11.Clear()<br />
<br />
OleDbDataAdapter1.Fill(DataSet11, "PatientsTable")<br />
End Sub<br />
<br />
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click<br />
Dim delc As New OleDbCommand()<br />
Dim message As String<br />
Try<br />
delc.CommandText = " Delete from PatientsTable where Patient_No =" & TextBox1.Text<br />
delc.Connection = OleDbConnection1<br />
OleDbConnection1.Open()<br />
delc.ExecuteNonQuery()<br />
<br />
MsgBox("The deletion procees done successfully .")<br />
<br />
Catch<br />
message = "choose a record first"<br />
MsgBox(message)<br />
Finally<br />
OleDbConnection1.Close()<br />
clear()<br />
End Try<br />
End Sub<br />
<br />
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click<br />
Dim selcom As New OleDbCommand()<br />
Dim drobj As OleDbDataReader<br />
Dim message As String<br />
<br />
Try<br />
selcom.Connection = OleDbConnection1<br />
selcom.CommandText = "select* from PatientsTable where(Patient_No= " & TextBox1.Text & ")"<br />
OleDbConnection1.Open()<br />
drobj = selcom.ExecuteReader<br />
If drobj.Read Then<br />
TextBox1.Text = drobj.GetValue(0)<br />
TextBox2.Text = drobj.GetValue(1)<br />
TextBox3.Text = drobj.GetValue(2)<br />
TextBox4.Text = drobj.GetValue(3)<br />
TextBox5.Text = drobj.GetValue(4)<br />
TextBox6.Text = drobj.GetValue(5)<br />
TextBox7.Text = drobj.GetValue(6)<br />
<br />
Else<br />
MsgBox("The record not found .")<br />
End If<br />
<br />
drobj.Close()<br />
<br />
Catch<br />
message = "You must write just a patient number in it's field "<br />
MsgBox(message)<br />
Finally<br />
<br />
OleDbConnection1.Close()<br />
<br />
End Try<br />
<br />
End Sub<br />
<br />
<br />
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click<br />
Close()<br />
End Sub
with thanks
deema
-- modified at 23:28 Thursday 10th November, 2005
|
|
|
|
|
On which line of the above code is an error being thrown, and what is the error?
...Steve
|
|
|
|