|
I also need this functionality. I've written a custom word wrap function, but the height of each row doesn't grow to show the wrapped text. This seems to be a real nightmare!
Don't worry, nobody lives forever.
|
|
|
|
|
It would appear that the best way tp do this would be to create a custom column class. Could anyone who's done this offer some help? I have a function that will do the word wrap based on a given width, font, and graphics object.
Don't worry, nobody lives forever.
|
|
|
|
|
Hi
I wrote a custom column style. The style only allows viewing, not editing. (Time is money, and money is something my client doesn't like parting with.)
The main problem is that the column style needs to return the preferred, and minimum, width and height for it's contents BEFORE the paint operation takes place. I fiddled this by making a fixed height, and then the form housing the datagrid resizes the wrapped column so that the sum of the column widths equals the datagrid width.
Too much code to include here, but you get the idea. Imperfect solution for an imperfect world. (Or is the world imperfect because people like me are willing to settle for less than perfection?)
Don't worry, nobody lives forever.
|
|
|
|
|
<code>Dim writer As XmlTextWriter = _
New XmlTextWriter("..\Sample0.xml", System.Text.Encoding.UTF8)</code>
|
|
|
|
|
there is a xml file: price.xml
<price>
<comdt>
<Tname id=0>AAA</Tname>
<Tprice>0</Tprice>
</comdt>
<comdt>
<Tname id=1>BBB</Tname>
<Tprice>0</Tprice>
</comdt>
</price>
the price is null,
now I have a array,arrprice(i),
arrprice(0) is AAA's price,
arrprice(1) is BBB's price,
How to use the arrprice(i) update the xml file?
I tried this way,
For x = 0 To 1
Set objprice = objDom.SelectSingleNode("//price/comdt"&[x]&"/Tprice")
objprice.Text = arrprice(x)
but it doesn't work.
Thank you!
|
|
|
|
|
Hi! I am in WAY over my head here and was hoping someone could help me out. I need a db that is like a time clock. Employees clock in and out, time is entered into table, and reports are run to show hours worked. I have no formal training in computers, so please bear with me One of my current problems is directing the data to the login or logout field. It only enters into the login field now. My next problem is that I need to tell the user his time is entered, and then refresh the form for the next user. I tried the Docmd.OpenForm, but it opens a new form on top of the previous one, creating quite a mess! I read about loop while or loop until, but...basically I'm clueless . One more problem---it doesn't always work. I don't see the rhyme or reason, but sometimes the time is entered, sometimes not, and sometimes it is entered for ALL employees. Can anyone help me? Please be gentle, remember, I am new to this!
The set up is:
tblStaff
StaffLoginName
StaffPassword
tblLoginRecords
LogStaffLoginName
LogPasswordEntered
LogINTime <---(all times currently enter here)
LogOUTTime
LogProblem (yes/no check)
frmLogin
bound controls: Your Name [LogStaffLoginName]
Enter Password [LogPasswordEntered]
(hidden) LogTime [LogINTime]
(hidden) LogDate [LogINDate]
Log IN (cmd8)and Log OUT (cmd 9) buttons (code follows)
(hidden) yes/no check box for LogProblem
___________________________________________________________________________
Private Sub Command8_Click()
On Error GoTo Err_CmdLogin_Click
If [LogStaffLoginName] = DLookup("[StaffLoginName]", "TblStaff", "[StaffPassword]=forms!frmlogin!LogPasswordEntered") Then
MsgBox "Your time has been logged.", vbOKOnly, "Login Confirmation."
DoCmd.OpenForm "frmLogin", acNormal
Else
Me!LogProblem = -1
MsgBox "Incorrect UserName or Password. Please try again.", vbOKOnly, "Login Error."
DoCmd.OpenForm "frmLogin"
End If
Forms!frmLogin.Visible = False
Exit_CmdLogin_Click:
Exit Sub
Err_CmdLogin_Click:
MsgBox Err.Description
Resume Exit_CmdLogin_Click
End Sub
Private Sub Command9_Click()
On Error GoTo Err_CmdLogout_Click
If [LogStaffLoginName] = DLookup("[StaffLoginName]", "TblStaff", "[StaffPassword]=forms!frmlogin!LogPasswordEntered") Then
MsgBox "Your time has been logged.", vbOKOnly, "Logout Confirmation."
DoCmd.Save acTable, "[LogOUTTime]", "tblLoginRecords"
Else
Me!LogProblem = -1
MsgBox "Incorrect UserName or Password. Please try again.", vbOKOnly, "Logout Error."
DoCmd.OpenForm "frmLogin"
End If
Forms!frmLogin.Visible = False
Exit_CmdLogout_Click:
Exit Sub
Err_CmdLogout_Click:
MsgBox Err.Description
Resume Exit_CmdLogout_Click
End Sub
__________________________________________________________________________
I know it's a mess now sorry. I see that in the form there are controls w/ LogIN times, but I am just not seeing the logic and how-to to seperate these and allow for logOUT times, while tying into the two seperate buttons. I hope that all made sense, and thank you to all for your attention!
Dazed and confused~~~Tiff~~~
I have no special talents. I am only passionately curious.
--Albert Einstein
|
|
|
|
|
Hello Tiff:
I have a didn't see a field for the date in the logins table and I think that in the same table you only need the user name to link this field whit the one in the staff table, to display only one time the form you can check if its display or use modal mode on when you display the from, one question what version of VB your using?.
JA
|
|
|
|
|
Hi JA! Thank you for looking The logINTime and logOUTTime are date and time fields. I thought this would be easier for calculations. They are set as 01/01/2004 12:00 in the same field.
I am using Access 2000 w/ VB6.
I have no special talents. I am only passionately curious.
--Albert Einstein
|
|
|
|
|
HI
I want to develop an interactive .net service that creates
a notifyicon at startup, so that the user can interact
with it (e.g. a double click on the icon in the systray
shall cause the service to react). So I placed such a
control in the service class and made it handle double
click events ..... but just nothing happens! When I
doubleclick the icon in the systray the appropriate code
in the service is not called and executed!!
can anyone help me??
mosquitooth
|
|
|
|
|
Make sure the service has the option turned on that allows it to 'interract with the desktop'.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
i have problem in vb with timer control i want the miliseconds but whenever i try it by using format() function or Second(Time) function it shows the required result but the seconds are allways in 2-4-6-8 manner in 4 bit format what can be the problem how can i get the exact time on my form?
|
|
|
|
|
the timer control is not this accurate..
it can't get millisconds .. so it seems it steps 2 millisconds.
maybe you'll need to use windows timers (you'll search some APIs)
|
|
|
|
|
The Timer control doesn't have that kind of resolution. You can use 3rd party high resolution timers such as the CCRP High Performance Timer Objects. The package can be found here[^]. It was originally written for VB6, but can be used in VB.NET also.
RageInTheMachine9532
|
|
|
|
|
OK, I'm builing an app (in VB6 as I know it much more than .NET) that has only two form items. A combo box and a button. The combo box has about twenty options that the user can select and it will launch IE and take the user to the specified page. The user can also type in a fully qualified domain name and it will take them to that page.
All that works perfectly.
However, I am trying to add the ability for users to search google by typing "Google:blah" replacing blah with whatever they want to search for. The way it's working right now is that it is trying to open a webpage with the name "google:blah" and of course, IE can't find it.
I have it coded to select the first 7 characters in the text box, but can't get it to remove them and search google if the first sever characters are "Google:". Any help? I'm just not sure how to remove the selected text. I was trying the following code, but it's not working:
go = go - cboChoose.selText
'I also tried this:
go = go - cboChoose.selLength
Here's a copy of the current file so you can see what I mean.
Any help?
|
|
|
|
|
I think I've got the solution for your problem:
'Variables<br />
Dim go As String<br />
Dim totallength As Integer 'the total length _<br />
'of the google:blah expression<br />
Dim searchlength As Integer<br />
'the length of the expression the user _<br />
'wants to search for (e.g. blah)<br />
go = cboChoose.Text<br />
totallength = Len(go)<br />
searchlength = totallength - 7<br />
go = Right(go, searchlength)<br />
'now the string variable go contains the expression<br />
'the user wants to search for
This code might not be perfect, but it works!
|
|
|
|
|
Very cool! It worked perfect (with a few mods so it works with my code).
Can you test it out now? I'm including a link to download a zip file which contains the app plus source.
I also have another thing i'd like to do. I have it setup so that the button "Go" is not the default because if it is, then the Google: search feature doesn't work if you hit return. I am trying to fix that by adding code that will capture if a user presses the Return key and it will then call the function "cmdGo_click". It's explained more in the source.
Source and App
Thanks,
Keith
|
|
|
|
|
The following code should work:
Private Sub Form_KeyDown(Keycode As Integer, _
Shift As Integer)
If Keycode = vbKeyReturn Then
cboChoose.SelLength = 7
cmdGo_Click
End If
End Sub
But there's still another problem:
Your application only works with English
Windows versions. I use Windows XP Home
German, and the program crashed because
the name of the 'Program Files' directory
is translated into the OS' language.
|
|
|
|
|
Well, the application was designed for in-house use at the company I work for, but I can see that it will be cool to release. So, what directory is equivelent to "Program files"? I know that there's a system command that can be used as the root folder (like Windows is %sysdir% or something like that. Anyone know that command?
I'm releasing another version that incorporates the above code (i put it in cboChoose instead of Form so it'll work).
Yet another version
Thanks again M_M_G
|
|
|
|
|
One important thing that I forgot in the message above:
Make sure the form's KeyPreview property is
set to true!
|
|
|
|
|
I forgot it and changed it and it doesn't seem to matter either way. Odd thing, it won't do the Google: feature the very first time i press enter. I have to close the IE windows that comes up and press enter in my app again for it to correctly search Google.
The program works perfectly for all features when just pressing the cmdGo button manually.
|
|
|
|
|
I don't really know why , but I finally got it to work the first time I press enter. This is what I changed:
Dim GoogleCheck<br />
GoogleCheck = Left(go, 7)<br />
If GoogleCheck = "Google:" Then <br />
[...].
I don't know how to get the name of the program files directory. This would be MUCH easier when using VB.NET!
|
|
|
|
|
Holy crap! It works!
Thanks a ton M_M_G.
I'll have to start coding in VB.NET so I can actually get this to work right. If you want, send me the directory that's equivalent to "Program Files" in the german version of windows and I'll write in a if then statement to determine which version the user's using.
|
|
|
|
|
Cool...
The German name of the directory is:
C:\Programme\Internet Explorer .
Will it be possible to download the final version from your website?
|
|
|
|
|
Cool.
Yeah - I'll post a final version later tonight. What sites do you want in there? The ones that are in there now are just for work purposes, so if you give me a list of some popular sites, I'll enter them in place of what I currently have in there.
Thanks again.
Keith
|
|
|
|
|
OK - I added in an error handler so it will catch your directory.
Here's the newest version - complete with a "working" Google: search tool, direct website access via combo box, and by typing in the address.
I personally will modify mine to be my most used sites and will take it with me on a flash drive.
Again, thanks a ton for your work on this. I'm going to clean up the code and post a zip file soon with complete source available.
If you post it though, I can recompile it with a list with whatever you want. Just tell me how you want it to look in the combo box and what sites you want listed. (ex: in my combo box, i have every categorized).
-Keith
|
|
|
|