|
Hello All,
Well i am working with collections in the project.
I have set the datasource property of the datagrid to a collection (I am not using dataset just the collection).
I am unable to format the datagrid using the tablestyles.
Would anyone please help me in formating the datagrid (using tablestyles) when the datasource property is set to a collection.
Thanks in advance,
P.S - I am unable to set the mappingname property in the tablestyle to collection.
if you send a mail at gokhale.i1@gmail.com in response to this query it would be better...
|
|
|
|
|
Hi, I designed my application in vb2005. I have a windows form application and contain combobox. My combo box contain an item and i set a dropdownstyle property to dropdownlist .
The problem occure when i try to delete the text from the combobox. I try to write the code combo1.text="" but the text still remain the combobox. Can anyone help me to solve this problem?
Thank in advance
|
|
|
|
|
try combo1.selectedtext=""
but why would you want to delete the text?
If it is because there is text in it the moment you start you form then you should put the selectedindex to -1
combo1.selectedindex=-1
you can also try
combo1.selecteditem=nothing
since you have set the property to dropdownlist the user can not type into it so the text displayed is whitout a doubt a item and therefor the selecteditem or selectedindex will most likly work best
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
TDDragon wrote: combo1.selectedindex=-1
Thank you very much for your help. Now I could remove the text.
|
|
|
|
|
Hey all!
I'm having an issue here, I have a panel whereby i draw my charts on it. Theres alot of computation done to have the charts drawn. So instead of runnning these computations again and again for everytime there's a repaint action, can i somehow save the stuff's ive drawn onto the panel and then when there's a repaint, ill just paint the graphics ive' saved ealier?
Thx in advance!
Regards,
jensen
|
|
|
|
|
Draw it to an image then repaint the image.
|
|
|
|
|
It's a common technique. Create a Bitmap the size of your drawing area, destroying and recreating a new one of appropriate size as your control resizes, and draw everything to this buffer. When you get a Paint event, draw the buffer to the screen.
|
|
|
|
|
Alternatively, you can split your code in two parts:
1. do the lengthy calculations and save their results in some data structure, without
drawing anything, then call Invalidate()
2. in your Paint handler, paint the drawing based on the content of your data structure
You have to balance this approach to the one based on a hidden bitmap: if you need lots
of resizing, this approach may be more appropriate since you can resize analytically
rather than by the pixels. If your output is more of a painting than a drawing, having
a bitmap probably would be better.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
thx all for the replies!
I'll use a bitmap and then redraw it out using but im yet to test it.
Ive' got another question to add; by implying the methods of saving onto a bitmap and redrawing it out smoothens the paint process? or i'll still be seeing flickerings like im seeing it now, its nth major actually but it just bothers the mind seeking perfection.!
and the fact that when i actualy do systems testing, i would wanna push it to the limits.
thx again!
regards,
jensen!
|
|
|
|
|
Hi, I changed the connection string datasource property to "DataSource = ../../data/databasename.mdb" instead of using the hard coded location(i changed this connectiong string everywhere in my application using the search function and entering the connection name). Anyways...I can't preview my data anymore now but it records to the database correctly? I have had to change the design of my tables in my database and now need to regenerate my data set as well as table adapters(I used all the built in tools to generate this before). How do I go about doing this? I am using vb.net 2005 and writing a windows application. PLEASE HELP!!!
Mr Oizo
|
|
|
|
|
Mr Oizo wrote: i changed this connectiong string everywhere in my application using the search function and entering the connection name).
If you have your connection string in more than one place, then your code is probably a maintenance nightmare in other ways, too. You should consider a better approach in future.
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 )
|
|
|
|
|
Well I used the the vb.net "add datasource" to create my connections. I just searched for everything with that connection name in the application.Then i changed the connection data source to a relative path. Anyways how would I regenerate my datasets and table adapters?
Mr Oizo
|
|
|
|
|
I don't use the dataset desginers at all, so this may be wrong.
But, I think you have to manually add the new/modified columns to the datasets. Open your Data Sources window, or click on the Data Sources tab if you have it, right-click on your dataset/table and click on Configure DataSet with Wizard. You should be able to add/remove the new columns in there.
|
|
|
|
|
Hello everyone,
Can anybody help me how to access public folders on exchange server.
For example 'Public Folder/All Public Folders/Email/2007/January/Sales/..
In my application I have a requirement to automatically file email messages and attachments.
Thanks
Nas
|
|
|
|
|
I can't seem to find a solution for this (and it's probably very simple)
Situation:
I have a combobox with a list(of string) as datasource
I've put the autocompletmode to append and the autocompletesource to listitems
everything works fine untill here
problem:
my users has to be able to type into the combobox but only text that is in the list
this works with a bit of code (check to see if there is text in the textpart of the combobox, if so check the list, if the list contains the text go on else clear combobox and start over)
but now when I start typing a word that is in the list the combobox appends the rest of the word (exactly like I want it) the only problem is that if I don't type the word out full the text that needs to be appended is not appended. The combobox only does this when I hit enter (this is not an option since the combobox is on a dialogwindow and hitting enter is accepting)
question:
anyone know how I can force the combobox to append the text when I leave the combobox (with tab)?
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
You could consider mimicking the combobox's behavior, in the leave event. If you do it with a little function, you would even be able to reuse it with other comboboxes.
Combob1.Text = YourLittleFunction(Combob1, Combob1.Text)
or
Combob1.SelectedItem = YourLittleFunction(Combob1, Combob1.Text)
and
Public Function YourLittleFunction(Byval combob as ComboBox, Byval TypedSoFar as String) as String<br />
'loop through the items in combob, and compare them with TypedSoFar.<br />
'Which ever comes closest is the winner.<br />
Return the winner<br />
End Function
Or something along those lines...
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
thanks for the reply
turned out I was able to do it very simpel with the code already in the leave event (the code that check wheter or not the text exists in the list) apperently the text that is apended is already in the .text property the only problem I had was that its case sensitive and the text in the list was uppercase and the text entered lowercase.
but you're post did help me with forming an idee of what was going on so thanks...
just in case you are wondering how I did it here is the code:
If cboType.SelectedItem = Nothing And Not cboType.Text.Equals("") Then
Dim l As New List(Of String)
For Each s As String In cboType.DataSource
l.Add(s.ToLower)
Next
If l.Contains(cboType.Text.ToLower) Then
cboType.SelectedItem = cboType.Text
Else
cboType.Text = ""
cboType.Focus()
End If
End If
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
Hello!
I have a rich text box with multiple lines. I can count number of lines but cannot find a line with maximum number of chracters.
Thanks for Any help.
colgateas900197
|
|
|
|
|
RichTextBox.Lines
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Luc Pattyn wrote: RichTextBox.Lines
Doesn't that just tell how many lines are in the control? Sounds like the OP wants the line with the most characters in it
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
public string[] Lines { get; set; }
tells a lot, including the number of lines, and with a simple loop also the length of
the longest/shortest/whatever line.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Luc Pattyn wrote: with a simple loop also the length of
the longest/shortest/whatever line
I figured once one grabs the info from Lines , they could pretty much do whatever at that point
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hello all, this is my first posting in codeproject. Does anyone know how to make mp3 playlist like winamp playlist... Need help... >_< The concept is just the same as winamp, we can add song with the add button, then the song will appear in the list. Some forum said that I should use datagrid component in vb.net, but I don't know what to do with that thing. Don't know how to add data to the datagrid, etc. lol. I still don't know how to use MSDN help. T-T Heeeeelllp...
- No Signature Available -
|
|
|
|
|
it depends on the format you want, but if you want to use the universal .m3u playlist format read and learn something about collections but just use these codes...its a real bad programming practice, not that, but it works
Dim sr As IO.StreamWriter = IO.File.CreateText(Application.StartupPath & "\Playlists\" + TextBox1.Text + ".m3u")
sr.WriteLine("#EXTM3U")
lstItems = ListView1.Items.Count - 1
For i = 0 To lstItems
'ext = System.IO.Path.GetExtension(CStr(ListView1.Items(i).SubItems(0).Text))
'w = CStr(ListView1.Items(i).SubItems(0).Text + ext)
sr.WriteLine(CStr(ListView1.Items(i).SubItems(1).Text))
Next
sr.Close()
sr = Nothing
w = Nothing
do u understand the codes...i used directx to do a music player and a dj soft
try this out
phatkin
|
|
|
|
|
create a txt file with the format .m3u
the write the first line as
sr.WriteLine("#EXTM3U")
then write the location of all the songs in the playlist
the save it..u can even open with VLC or windows media player
but its a real bad practise so go and read on collections
phatkin
|
|
|
|