|
Hi Jonathan
I am sorry for my earlier post. where would i be using expanded method.
a code hint will be great coz i am running out of ideas as i am very new to this.
thanks
|
|
|
|
|
That answer is in my first response to your question. Go view it, and come back if you still have complications.
Best of luck!
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
I do really understand what you are trying to say in your previous post but the thing is i just dont know how to convert them into coding level.
when user selects a particular node and clicks it i somehow need to store that value so that i can go search for selected new node and populate it after postback on page load.
but i dont know how to do it. please help
i managed to get it working using a framesets but i am not quite happy with it. i just want to learn how to make this working without using framesets.
|
|
|
|
|
Hi!
If you look in my code carefully. I have binded the treeview with the data returned from a dataset. I dont know how can i utilize your code. All i am trying to do is.
some how get the node value or ID of the treeview after postback i.e. after line
nodeAutoCat.NavigateUrl = "Index.aspx?CatId=" + Server.UrlEncode(
CType(rowAutoCat("CatId"), String)) is executed.
so when the page loads up with above url
Index.aspx?CatId = 15
I am filtering the datagrid in my page load with the products that belongs to category 15 [ In the content page of Main page]
and I want to have the treeview expanded to the node which was selected just before the postback [Navigation pane in main page]
but all my node gets collasped after postback but i can filter the datagrid.
please help.
a code hint will be great.
|
|
|
|
|
Edit your original post - don't create another
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
To begin, I have just started a VB.Net course. I am an absolute begginer, so be gentle with me.
I have a problem with getting the correct amount of days in the right month. I have been at this all day and i'm still stuck.
Any ideas would be most helpful
Regards Cedrick de'Orange
|
|
|
|
|
You'll find your answer in the Date object. There is a public method called DaysInMonth which takes two arguments, the Year, and the Month - both integers.
Label1.Text = Date.DaysInMonth(year As Integer, month As Integer)
Label1.Text = Date.DaysInMonth(2006, 7)
"I forgot to add, I am using a domain up and down for the months and a numeric up and down for the days"
What do you mean 'domain up and down'. As for the Numeric up and down controller, just use the .Value property of the NumericUpDown control. You will also have to cast the value to an Integer, because the DaysInMonth method will not accept a Decimal value, which is what NumericUpDown naturally is.
Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown1.ValueChanged
Label1.Text = Date.DaysInMonth(2006, CInt(NumericUpDown1.Value))
End Sub
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
My question is rather simple. We all have played computer games, or other console-based games, where at any given moment you can type in "thereisnotry", or something similar and it activates a new feature, be it a class method giving you maximum health, or whatever.
How exactly can that be done in VB.NET? Line, at any time if I type in "magic string" I can catch that event (is that an event?) and handle it...
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
What type of application is it?
In a Windows Forms application you could look at using the KeyPress event. You will, though, need to handle the event for each control on the form
Private m_strCapturedString As String = ""
Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If System.Char.IsControl(e.KeyChar) Then
Exit Sub
End If
m_strCapturedString += e.KeyChar
If m_strCapturedString.Length = 10 Then
MessageBox.Show(m_strCapturedString)
End If
End Sub
Private Sub Button1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Button1.KeyPress
If System.Char.IsControl(e.KeyChar) Then
Exit Sub
End If
m_strCapturedString += e.KeyChar
If m_strCapturedString.Length = 10 Then
MessageBox.Show(m_strCapturedString)
End If
End Sub
|
|
|
|
|
You don't have to handle the keydown event of every control. You just have to do it in the Form's KeyDown event. But, in order for it to work, you have to turn on (True) the Form's KeyPreview property.
There is no event for the typing of a string of characters, only one keystroke. Your Form's KeyPress event handler code then has to keep track of the last "x" number of keys that were hit and compare them to the string you want as your "cheat" string.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hey guys,
how do i ensure that my crystal report looks for the database with in the application folder.
Thanks
Ricky
|
|
|
|
|
In the connection string to your database, make sure you specify the full path to the database file. You can get the path to your .EXE using Application.StartupPath .
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
Thanks, I tried that but no luck maybe if I explain a bit more it would help. am writhin application that the result for the form is preview with crystal report. In crystal I create a OLE DB connection to the database. when I deploy the application it is looking report database on the machine that it was develope. example of code:
Dim path1 As String = My.Application.Info.DirectoryPath '' path
'' change path of the database
report.DataSourceConnections.Item(0).SetConnection("", "" & path1 & "\db.mdb", False)
review and give me ur feed back, even it there is a better way to bind the report i would gladly accept
thanks
-- modified at 17:40 Wednesday 22nd November, 2006
|
|
|
|
|
Is there a way to program in vb.net for different screen sizes and resolutions ???
silver-gray
|
|
|
|
|
I always try to program for the smallest and then make the forms resizable upwards if the users wants to.
They key to this is deciding what is the lowest res you will aim for. Lately I have been selecting 800x600 instead of 640x480.
Does Vista even support 640x480 anymore?
|
|
|
|
|
Ray Cassick wrote: Does Vista even support 640x480 anymore?
Yes they do.
|
|
|
|
|
Ray Cassick wrote: I always try to program for the smallest and then make the forms resizable upwards if the users wants to.
I use this technique too. Luckily was told that I did not need to support resolutions below 1024x768 so I had more space to play with.
Making forms cope sensibly with resizing can be interesting. Using anchor is limited. I used "Top, Left, Right " anchor for a text box and a user in UAT complained that the user interface looked horrible. She was always maximising her window and ended up with way wider text boxes then required. So I put in a minimum and maximum window size to make sure the display always looked sensible.
If you are using .Net 2.0 you could also look at using the various flow layout options available in Windows Forms.
|
|
|
|
|
Are you saying that re-sizing is a manual thing? or is there a way to programmaticlly change it under the covers ??
silver-gray
|
|
|
|
|
There are a few ways to do it (anchoring, code, layout panels, etc...) but it all takes some intervention on the part of the developer to implement it.
|
|
|
|
|
can you please elaborate. what do you mean "(anchoring, code,layout panels,etc)"
Thanks
silver-gray
|
|
|
|
|
By 'anchoring' I mean the use of the anchor properties of controls placed on a form to allow them to attach to one area and then stretch in another direction when the form gets re-sized. Works OK for basic stuff but complicated forms can cause issues.
By 'code' I mean capturing the current size of the form in the appropriate events and then manually resizing the controls using pure code. Lots of work and very hard to get right. It also tends to result in very 'brittle' code when you need to make changes in the design latter on.
By 'Layout Panels' I mean placing a layout panel on the form and then allowing that to adjust the size of container controls.
Good luck, and run a search or two in Google to get the rest. Sorry for being sketchy here, but this is one area where I could go done a slippery slope and end up writing code that I don't care to right for you. This is a 'give a man a fish vs. teach a man to fish' thing.
Hope you understand.
|
|
|
|
|
When running my program I get the following error message:
Line 1: Incorrect syntax near '82'.
Unclosed quotation mark before the character string ".
I have been trying to fix this for days now and it's driving me insane.
Any advice would help.
jds1207
|
|
|
|
|
Do you want to post the code so we can see what you did wrong, or what? At the moment, the only thing we can suggest is to make sure your quote marks match up where they are supposed to.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Keep in mind how escaping quotations takes place in VB.NET
Label.Text = "Hello World, You can call me ""Jonathan""."
If you want " in your string, you need to double it up - one escapes the other. So for every instance of " in your string, you need to put in "".
Hope that helps!
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
My dataset binds to a textbox to display a particular record when I click a select button.
I clear the textboxes by clicking my clear button.
I receive an error that two bindings cannot be done on the same object whenever I tried to select a new record without closing the form.
Pls how should I bind the textbox to the dataset such that I will not have to close and open the form to select subsequents record.
Fikunmi Feyijin
Hicad Systems
Nigeria
|
|
|
|