|
Yes I appreciate what you suggest. But some application can need it sometime
In case of Excel, we should not able to add more than 255 sheet! No we can.
I got the solution for the above question.
Instead of using "Microsoft Common Dialog Control 6.0"
I will use "Microsoft Forms 2.0 object Library" TabControl
Regards
Anil
|
|
|
|
|
Tabs inside Tab, then suddenly you can put 255 x 255 tag pages! I would hate to be the user, or in general vicinity of that application....
Or you can redesign the application by dynamically load the form/area that the user want to look at.
|
|
|
|
|
darkelv wrote: Tabs inside Tab
I did not get u ?...
Any way I just told that Windows Common Control's tab control can not handle more than 255 but the other one can handle in thousands..
And of course the tabs added are dynamically. No body is going to give user interface with 255 tabs. But we can think of extreme conditions. If you are using VC interface I think it can open more than 255 files at a time in different tabs. But in practically no one would ever open...
U are using lots of application that support more than 255 tabs
If you are reading this article in Firefox now it might able to open 255 tabs,
Regards
Anil
|
|
|
|
|
I am creating a database using MS Access. I want to have the Member ID field to able to generate 5 digit Random Numbers that will not duplicate (unique)on Get Focus. I have very little experience in VB coding.
Please help to write VB.net code for accomplishing this need.
Thank you all.
Ramble
|
|
|
|
|
RambleWoods wrote: 5 digit Random Numbers that will not duplicate
that is a contradiction, it is either random or unique, can't be both: after 99999 numbers I
will be able to predict your last number, how random is that?
The one way to get uniqueness with maximum random appearance, is by creating the entire
collection of numbers, then picking one at random and removing it from the collection,
until all are gone.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
RambleWoods wrote: I have very little experience in VB coding
Then how did you inherit this task ?
The easiest way to do this ( although nasty ) is to make the column unique in your database, then keep generating numbers until one is not found in the DB. This is, of course, a disaster. The other way is to build a list of all possible numbers, then remove all numbers already in use, and pull numbers out of that list at random ( which is pretty much what Luc said ).
One other way is to create a GUID column in your database, but that's more than 5 characters. It does have the advantage of happening all in the DB. I've done licensing where we use 12 character keys and I generate them in the data layer in a proc that generates GUIDs, checks if a substring is already in the DB, and if not, spits them out.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Do you know the codes for doing random numbers in VB? If you do help me.
|
|
|
|
|
Public Sub AppendTrackNumLog(ByVal LogText As String)
Dim LogInfo As System.IO.FileInfo
Dim createDate As DateTime
LogInfo = My.Computer.FileSystem.GetFileInfo("t:\PowderedLogs\TrackNumLogPowdered.txt")
createDate = LogInfo.CreationTime
If Date.Now >= createDate.AddDays(7) Then
My.Computer.FileSystem.DeleteFile("t:\PowderedLogs\TrackNumLogPowdered.txt")
End If
Try
Dim TimeStamp As String
TimeStamp = Date.Now()
If My.Computer.FileSystem.FileExists("t:\PowderedLogs\TrackNumLogPowdered.txt") = False Then
My.Computer.FileSystem.WriteAllText("t:\PowderedLogs\TrackNumLogPowdered.txt", String.Empty, False)
My.Computer.FileSystem.WriteAllText("t:\PowderedLogs\TrackNumLogPowdered.txt", Environment.NewLine + LogText + " - " + TimeStamp, True)
Else
My.Computer.FileSystem.WriteAllText("t:\PowderedLogs\TrackNumLogPowdered.txt", Environment.NewLine + LogText + " - " + TimeStamp, True)
End If
Catch ex As Exception
MsgBox("Error: Writing to TrackNumLog")
End Try
End Sub
Now this code is supposed to simply delete and re-create a Log file. It works in the sense that it doesn't create an error. It also will delete and re-create the file but it doesn't change the Create Date. It wipes the file and puts the just the new info, but because it doesn't change the create date, every time the code runs it deletes the files, now if i step through the code and stop right after the delete line of code runs and go and physically check the folder, the file isn't there, then i continue to run the code, and when the code is done, i got back and check the file is there now, AND has a new creation date, now why would it not change the creation date unless i physically go to the folder and look for the file???? Its like the because the file is deleted and created so fast in the code that it doesn't register that its a new file.
|
|
|
|
|
This is a known problem/effect, and there is a Microsoft article about that you can probably find if you look for it. There is also a previous thread about it here on CP.
If you create a file with the same name as a previously deleted file, it will get the same creation date as the previous file.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Does this mean if someone uninstalls my program and reinstalls it, it will have the old creation date ? That's helpful to know for doing trial licensing and so on.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
Please can you help me.
I've got an application that's a diary and contains 4 text boxes, and a Month Calendar. I've worked it so that I add an entry and save the details to the table. No probs. I've got a DIARYID, FKOWNERID and FKPONYID.
The problem I've got is where the Owner has 2 ponies. When they select the 2nd pony then the Diary loads the 1st ponies details. It is not going through the binding source at all.
The code I'm using is below:
Imports System.Data.SqlClient
Public Class SOCIALDIARY
Dim AddNewEntry As Boolean = False
Dim DeleteNewEntry As Boolean = False
Public Sub PonysDiaryLoad()
Dim i As Integer = 0
Hallofrm.MYOWNERBindingNavigator.BindingSource = Me.MYPONYSDIARYBindingSource
Me.MYPONYSDIARYTableAdapter.FillByPony(Me.Database1DataSet.MYPONYSDIARY, CurrentPonysId)
Hallofrm.btnClosePony.Visible = False
If Me.Database1DataSet.MYPONYSDIARY.Rows.Count > 0 Then
CurrentDiaryID = Me.Database1DataSet.MYPONYSDIARY.Rows(Me.MYPONYSDIARYBindingSource.Position).Item("DIARYID")
Dim DiaryDates(Me.Database1DataSet.MYPONYSDIARY.Count - 1) As DateTime
For Each dr As DataRow In Me.Database1DataSet.MYPONYSDIARY.Rows
DiaryDates(i) = dr("DiaryDate")
i += 1
Next
MonthCalendar1.BoldedDates = DiaryDates
End If
lblDiaryId.Text = CurrentDiaryID
lblPonyID.Text = CurrentPonysId
End Sub
Any advise would be greatly appreciated.
Thanks:
Kris MCP
modified on Thursday, February 21, 2008 9:44 AM
|
|
|
|
|
I'm working in a project for blind people.
Every windows OS has it's own text to speech engine and voice, this voice is the awfull MICROSOFT SAM voice. It can be ok if you are English and you have no ears, but for foreign languages it is useless and blind people have very sensitive ears...
Appart from the discussion we should have about why if I buy and pay an OS in Spanish I do have to deal with an English voice I wonder if one of you, CODE GURUS, should be able to make a small installer masterpiece that will replace the old MICROSOFT voice with another nicer and from desired language. For blind people it is hard to configure windows, so the nicest thing is to have an app that changes the features by itself, so after executed, the default voice should be the new one...
Normally, if you want to add a new voice, forums said that you need folowing files:
msagent.exe
agtx0c0a.exe
lhttsspe.exe
spchcpl.exe
I have installed all of them and nothing happened...
You can download them from here:
http://www.telecable.es/personales/jrubi/index.htm?trucos/tip00225.htm
Maybe there's already a similar app, any tips will be wellcome !!
|
|
|
|
|
I can't beleive nobody can help with this.
I have already an installer with all the required files embeded on it, the only thing I need is an app that changes the windows registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech to the new speech voice. At least give me some hints on how to do it, because do it manually is quite difficult for someone dissabled.
|
|
|
|
|
Okay Q, a few tips:
1. the amount of participants on this forum who do not work for Mickeysoft is much larger than the amount of people who do, and even the ones who do, probably have nothing to do with your friend SAM. Even if you are frustrated about something not working out, you're really going to kill your chances of getting help by suggesting that anybody here is responsible for your problems, and that they should help you. Angry rambling will get you nowhere.
2. guilt trips may have helped you get things done in the real world, but this is the internet (100 stories and 1000 lies), we will just have to take your word for it that you are helping disabled people, instead of writing a virus.
3. ask an actual question, as suggested in the very first post on this forum. You are much more likely to get a helpful answer. People here will try and help you solve your problem, they will hardly ever just hand over ready solutions to vague problem descriptions.
4. you are apparently competent enough to find solutions on the web. You prove this with your own answer to your first post. You made it onto this forum, so supposedly you know some programming. If you type your question in Google, you will find loads of articles on how to write a small app that will make the necessary changes in the registry, for example: http://vbcity.com/forums/faq.asp?fid=30&cat=Registry[^]
it isn't all that hard. If you think this is, you need to buy yourself a book on programming and learn, or else you need to hire someone to write the program for you.
I am sorry if my answer pisses you off, and I do wish you good luck solving your problems.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Well, actually it is true that I'm working for dissabled people at the moment, and your thoughts and escepticism, even though they are reasonable, they show the kind of person you are.
I'm not rambling angry, this is your own understanding of my lines. For you it looks like I'm trying to make you responsible of my problems, that only shows again the kind of person you are. I was just trying to encourage you.
I don't think it is necessary to mention dissabled people to get some help on the Internet, fortunately, there are a million people clicking around that will help without any use of guiltyness.
Yeah, you pissed me off, do you know why?
Because you came here making serious acusations without even knowing a single thing about me.
If you have a solution or an answer, you can just drop it and keep your sick thoughts for yourself and your toilet time, you don't need to prove how smart you are and neither need to make me read those awful lines just to give me this tip. I know what is Internet, thank you for the advice.
Thank you too for your link, even though it is not only a question of changing registry, but more extense.
But you are right, I did not explain myself pretty well and I was in the wrong forum too.
I wont come back, so keep your energy and don't answer me back.
|
|
|
|
|
When I ran the debugger I get an error that says that it can't find this column in the database. I know the column exists.
Does anyone know why?
Dim dcDay As New DataColumn("Day of Week", GetType(String), "lpDataSet.tbl_teach_sched.ts_dayColumn")
modified on Wednesday, February 20, 2008 12:57 PM
|
|
|
|
|
It can't find the column because the expression you supplied isn't valid. You shouldn't be specifying DataSet names and tables in it. All it needs is column names or some expression that assumes the correct table.
|
|
|
|
|
I did not have option strict on and when I ran the debugger I got an error message that said conversion from DBNull to Date is invalid. I checked my database and I do not have any NULL's in the database at all.
Why am I getting this error?
Then I turned option strict on and I get errors that say implicit conversion from type object to either date, Integer or string are not valid.
Dim dr As DataRow<br />
Dim intDay As Integer<br />
Dim intDays As Integer<br />
Dim intStudID As Integer<br />
Dim intLessID As Integer<br />
Dim startTime As DateTime<br />
Dim endTime As DateTime<br />
Dim lessTime As DateTime<br />
Dim foundRows() As Data.DataRow
Here is the code that is underlined with option strict on.
intDay = dr("ts_day")<br />
startTime = dr("ts_from")<br />
endTime = dr("ts_to")<br />
intStudID = foundRows(0)("stud_id")<br />
intLessID = foundRows(0)("less_id")<br />
lessTime = foundRows(0)("less_time")<br />
intDays = foundRows(0)("less_day") - 1<br />
' This is at the end of the loop to increment the start time<br />
startTime += startTime.Add(timeInterval)
To use option strict on how should I do this? The dataRows hold information from the database.
|
|
|
|
|
You're getting the errors because you're not explicitly converting the values returned by the DataReader to the appropriate types. You're still relying on implicit conversions. All of your "dr(something) expressions return an Object, not an Interger or String or DateTime. You have to explicitly convert those Objects to the appropriate types:
intDay = Convert.ToInt32(dr("ts_day"))
|
|
|
|
|
When I declare startTime I declare it as a DateTime. Also timeInterval is declared as a timespan. Why does this give me an error that it can't convert from date to string?
startTime += startTime.Add(timeInterval)
|
|
|
|
|
Don't know. There isn't enough information to tell. Possibly, your datetime is stored in the database as a string??
|
|
|
|
|
I created a UDT named time from dateTime. The database stores both the time and the date 1/1/1900. Then with the following code I convert it to dateTime because the info is in a dataRow. Does this help?
startTime = Convert.ToDateTime(dr("ts_from"))
|
|
|
|
|
AAGTHosting wrote: The database stores both the time and the date 1/1/1900. Then with the following code I convert it to dateTime because the info is in a dataRow. Does this help?
None of this makes any sense, so no.
You created your own datatype, inheriting from DateTime?? May I ask why and what the implementation looks like?
|
|
|
|
|
The code is equivalent to:
startTime = startTime + startTime.Add(timeInterval)
As you see, you are trying to add two DateTime values. There is no operator overload for the addition operator that does that, so the compiler tries to convert the values to types that can be added. The only conversion that gives data types that can be added, is converting them to String s. Therefore the compiler assumes that you are trying to do this:
startTime = startTime.ToString() + startTime.Add(timeInterval).ToString()
However, as you are using Option Strict On , implicit conversions from DateTime to String is not allowed.
The statement is illogical. Is it not this that you are trying to do really?
startTime = startTime.Add(timeInterval)
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Good evening All
I have found a new job and they want me to Stop vb.net and move to C#. well i have done C++ and Java in my Academic days and never used it again, and now that Pain world comes in again. i have never used C# , in VB.net we drop controls to the forms and start code behind the Control using different Events, in C++ its a Pain to Create a Form in old Java JDK 1.2 its realy a pain to design a Form, because you had to align the Controls in the pane. So what i want to know is that , If C# is a .NET language, do you still Drop a Control and Code its Event ? or its still a Pain of Creating UI ? and a lot or Arrays declaration, Threads ?, Cant i design my logics in vb.net and Allow a C# developer to Access those Logics ? cant we be on the same team but using different languages? is vb.net going to Die? What is it, that is in C# that we cannot do in vb.net? Cant vb.net do handle security ? are they not .NET languages ? on the Same PlatForm? is there a realy a need to move from vb.net to C#?
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|