|
Hi guys,
I am struggling to change the font style of a selected node in a treeview and a selected item in a listview control, your help is very much appreciated.
Regards
|
|
|
|
|
Got it and a bit embarrassed, its amazingly simple.
here are my lines, I used the AfterSelect event of the TreeView to set the font of the node, its parent and all its ancestors to bold, when another node is selected, i set the new node and its ancestors to bold, while returning the previously selected node to the normal font of the TreeView . By removing the while... statement in both methods, only the selected node is set to bold and back to normal. I know there are most likely better solutions but this one works fine.
<code>Dim previousSelectedNode as TreeNode
...
...
Private Sub Treeview1_AfterSelect(ByVal sender As System.Object, ByVal e As _ System.Windows.Forms.TreeViewEventArgs) Handles Treeview1.AfterSelect
Dim xnode As TreeNode
If previousSelectedNode IsNot Nothing Then DeSelectNode()
e.Node.NodeFont = New Font(Treeview1.Font, FontStyle.Bold)
xnode = e.Node
While xnode.Parent IsNot Nothing
xnode = xnode.Parent
xnode.NodeFont = New Font(Treeview1.Font, FontStyle.Bold)
End While
previousSelectedNode = e.Node
End Sub
'Deselecting a node
Private Sub DeSelectNode()
previousSelectedNode.NodeFont = Treeview1.Font
While previousSelectedNode.Parent IsNot Nothing
previousSelectedNode = previousSelectedNode.Parent
previousSelectedNode.NodeFont = Treeview1.Font
End While
End Sub
|
|
|
|
|
Hi i have a form with a datagridview and a listbox. The datagridview is bound to a table with 2 columns. the first column is a column that needs to store the name of a genre(specified in the listbox). the second column(which I have made invisible) is merely the name of the 24 hour template. what I mean by this is that the point of the datagrid is to allow a user to drag and drop genres to each hour of a day(so they need to drag 24 genres) onto the datagrid) and then save this as a 24 hour template. the datagrid is thus bound to the child table of a table called "24HourTemplate". when the user click save it will prompt for a name for the template and record the chnages to the 2 tables. how do I perform a drag and drop. I have enabled it for the tables but nothing happens?
Mr Oizo
|
|
|
|
|
Hi I am writing music and advert scheduling placement program for a radio station.I am nearing the final stages but need something that will allow the user to view the schedule and drag and drop songs/adverts into slots on the shedule. the problem is that everything is scheduled around time and constraints around that time(eg: a certain genre of music plays at a certain time of day). Basically I need something that displays the time in hours, minutes and seconds and can allow the user to drag and drop information into slots coinciding with specific times? Is there anything like this out there for free? Any advice on how I could make something like that? I was thinking of using a datgridview and then creating a schedule table which would just hold all the information the schedule needs and binding the 2 together?
Mr Oizo
|
|
|
|
|
Please don't double post. People here are volunteers and will answer your question when they are able, if they can provide an answer. Posting it a second time an hour later is a sure way to not get a response to either.
|
|
|
|
|
Hi my project im doing does music and advertisement placement on a schedule for playing on a radio station. It uses various selection criteria to schedule the playlist. I am nearing the final stages but am wondering if anyone could give me any advice how I should store the final playlist and what to use to display the completed schedule to the scheduler? at the moment I am thinking of using a datagridview. the problem is that everything is scheduled around the hours in the day and what types of music(specified by genre) and adverts need to play at certain times. I basically just need some type of tool or something that shows the hours, minutes and seconds in a 24 hour clock and allows me to drag and drop information coinciding with a specific time. Any ideas will be really appreciated. thanks
Mr Oizo
|
|
|
|
|
I have a strange problem
set up:
I have a mdi parent with server mdichildren (shown as tabs)
an mdichild has a control on it (datawindow) wich contains serveral fields
now when I create a new record for the first time the focus is set correctly on the correct field en the user can imidattly start entering data. But if we create another new record the focus is not set correctly. The code behinde the first and second new record is identicly (since it's the same code)
when I ask my form wich control has the focus it tells me that the correct control has the focus (datawindow) but still I can not enter any data without clicking in the control first. Even tab doesn't work, neighter do my schortcuts (who are at form level).
If I use alt-tab (to swith between open windows) and return to the programme (with alt-tab) the foces all of the sudden is set correctly.
I'v stept thru my code and nothing happens after I set the focus (it's the last thing I do)
On a side note:
the mdi child inherits from another form (but nothing happens there, at least not after I set the focus)
the same thing works on other forms just not on the last 5(or so) I created
Anyone have an idea what can cause this problem? Or how I can make sure the last thing the programme does is setting the focus?
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
i propose u change the tab-index for the form which doesnt focus correctly. Set the index to the desired order for data entry, then combine with the set focus code and should solve ur problem.
---------------------------
Baniani mbaya, kiatu chake dawa.
Regards,
Hesbon Ongira
Nairobi, Kenya.
|
|
|
|
|
tabindex is set correctly so that wasn't it
I solved it but still don't know why the problem occured in the first place
but apperently another control that I use was maintaining the focus nomatter what I did
so I just don't refresh it anymore (it's not needed anyway so)
thank you for you time
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
Hi friends..
I need to get all the .exe's running in a machine and display them in my application .How to do it..? In specific i need to get the .Net exe's alone..
Somebody help in this regard as early as possible..
Regards,
Balaguru
|
|
|
|
|
This is not exactly wat u want but i think it could be a starting point.
http://www.vbdotnetheaven.com/UploadFile/prvn_131971/machineprocessvb11182005001454AM/machineprocessvb.aspx
|
|
|
|
|
Hi Mbire..
Thx for the reply..But i need it specifically to .Net .exe's
Regards,
Balaguru
|
|
|
|
|
Public crxApp As CRAXDRT.Application
Public crxReport As CRAXDRT.Report
Public crxDataBase As CRAXDRT.Database
Public crxTable As CRAXDRT.DatabaseTable
Public crxTables As CRAXDRT.DatabaseTables
Public strSelectionfrm As String
Public strCRSourcePath As String
Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.MdiParent = frmMain
crxApp = New CRAXDRT.Application
crxReport = crxApp.OpenReport(strCRSourcePath, 0)
crxReport.RecordSelectionFormula = strSelectionfrm
crxDataBase = crxReport.Database
crxTables = crxDataBase.Tables
For Each crxTable In crxTables
crxTable.Location = DataSource
crxTable.SetLogOnInfo("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & reportPath, "myDatabase.mdb", "", "password")
Next crxTable
'Error occur here! i dont know why im access denied.. but if i will ommitt the .SetReportVariableValue() then it works just fine without committing access denied but then i have to set some variable i've declare inside the report..
crxReport.SetReportVariableValue("varEduc", "Hello Crystal World")
AxCRViewer1.ReportSource = crxReport
AxCRViewer1.ViewReport()
crxDataBase = Nothing
crxTable = Nothing
crxTables = Nothing
crxReport = Nothing
crxApp = Nothing
Catch ex As Exception
MsgBox(ex.ToString())
Finally
End Try
End Sub
***************
crxReport.SetReportVariableValue("varEduc", "Hello Crystal World")
the varEduc is already declare inside the report which means it is existing variable inside report..
is anybody there who have a good idea or solutions about this??? please???
Anybody there Please help me with this headache...
-- modified at 3:00 Wednesday 26th September, 2007
|
|
|
|
|
Hi all,
I want to connect to an Excel File in VB.NEt could anyone help me out
Thanks in Advance..
|
|
|
|
|
hi vidya
here's the code
Public Sub excelconn(ByVal exlpath As String)<br />
exconn = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; " & "data source='" & exlpath & "'; Extended Properties=Excel 8.0;")<br />
exconn.Open()<br />
Dim da As OleDbDataAdapter<br />
da = New OleDbDataAdapter("select * from [Sheet1$]", exconn)<br />
da.Fill(ds)<br />
End Sub
let me know if it works for you
help everyone
|
|
|
|
|
Thank u so much
Its working fine
|
|
|
|
|
All our winform apps are deployed using clickonce - works fine.
We have a central authentication and autorisation app and the logon DLL is deployed with each app.
We are building a single logon app to access all the apps.
I can locate the "application reference" in C:\Program Files\Group\......."
Using the App ref
Dim sApp As String = mvApp.Shortcut
System.Diagnostics.Process.Start(sApp)
I get the following error
System.ComponentModel.Win32Exception was unhandled
ErrorCode=-2147467259
Message="The system cannot find the file specified"
Source="System"
Does anyone have a suggestion how to launch a clickonce app from another VB App
|
|
|
|
|
The Application Reference resides under
C:\Documents and Settings\username\Start Menu\Programs\Group Risk
|
|
|
|
|
The appref has an extension that windows does not display (.appref-ms)- I had to use dos to get the extension - how quaint.
C:\Documents and Settings\username\Start Menu\Programs\Group Risk\StressMastr.appref-ms
System.Diagnostics.Process.Start(sApp) now launches the program successfully. Now to include a command line string!
|
|
|
|
|
Hi,
I have a project and I have designed the form, but I am not sure of my code. Can somebody help me plz?
This is the question of my project:
A local car rental company would like a computer application to calculate and display rental charges for each renter and summary rental charges for the day. The company charges AED60 per day plus AED0.8 for each kilometre driven by the renter. In this assignment, you are expected to use structured programming methodology to develop a user-friendly, high quality VB.NET windows system that will handle the following:
1. For each renter:
1.1the application must be enable the user to input the renter’s name, beginning odometer reading, ending odometer reading, and the number of days the car was used. The application will check to ensure that the name of the customer is not blank, ending odometer reading is greater than the beginning odometer reading, and that the beginning odometer reading and number of usage days are greater than zero – appropriate error messages must be displayed if incorrect data is entered by the user.
1.2when the compute and display button is clicked, the application upon ensuring that correct data has been entered, will calculate and display in appropriate controls, the charge for kilometres driven, the charge for the usage of the car, and the rental charge (sum of kilometre and usage charges). After displaying charge details for each renter, the system will update and display summary data (totals for kilometres, usage and rental charges).
2.Prepare for next renter’s charges or cancel the current renter by having a button for clearing all user entered data and computed details – but not the summary details. The summary details must always reflect the latest totals, and they are not to be cleared while the program is running.
|
|
|
|
|
*Muskan* wrote: Can someone give me the code of my project?
erm let me think about it... NO
Please read the forum guidelines.
You always pass failure on the way to success.
|
|
|
|
|
*Muskan* wrote: Can someone give me the code of my project?
This is a homework assignment. Treat this board as if your prof is reading it. Asking us to just handover the code is cheating.
|
|
|
|
|
Dave Kreskowiak wrote: Treat this board as if your prof is reading it.
I sure wouldn't mind having his professor's email address and drop them a line about the cheat
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
Seriously, assuming you manage to pass your course, when you get a job, did you hope to post here to get your work done for you then, too ?
You need to do your own homework, but, if you try and get stuck on specific things, we're more than happy to help you.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
We only assist when you have problems with your code. What u are asking for is for this forum to fix u up with a whole project! Wake up and work!
---------------------------
Baniani mbaya, kiatu chake dawa.
Regards,
Hesbon Ongira
Nairobi, Kenya.
|
|
|
|