|
iam not able to take that 2 parts seperately at the same time from the masked textbox.AT a time i can take only hours or minutes.not both.
Could u please tell me the condition to check whether the hours part falls in 00 to 23.because to put in a integer loop i will not get the values as 00,01...till 09.
please help.
rgds,
CHepps
|
|
|
|
|
In the validation method of the masked textbox (mt for now), I would do something like...
hr=cint(mid(mt.text,1,2))
min=cint(mid(mt.text,3,2))
if hr<0 or hr>23
' Error!!!
end if
if min<0 or min>59
' Error!!!
end if
Hope this helps.
|
|
|
|
|
Hi sa_runner,
The code that u gave works for me.Thank you.
But in the data entry , if i leave the hour part(then this will be space) or a minute part then this gives me a error saying space cannot be converted to integer.ACtually i should handle this type of entry (giving blank on either part) also and has to pop up a msg that "not a valid time entry'.
Is there a way?
Thanks and regards,
Chepps
|
|
|
|
|
I have a problem to show data in an OWC9 ChartSpace. I can bind the OWC spreadsheet (no error returned). However I get an empty chart despite the fact that the range on the spreadsheet contains numeric data.
This is the code to bind the chart and the spreadsheet (ctlSpreadsheet refers to the spreadsheet on the form, ctlChart referes to the chart on the form):
Me.ctlGraph.Clear()
Me.ctlGraph.Charts.Add()
Me.ctlGraph.DataSourceType = _ OWC.ChartDataSourceTypeEnum.chDataSourceTypeSpreadsheet
Me.ctlGraph.DataSource = CType(Me.ctlSpreadSheet, AxHost).GetOcx()
Me.ctlGraph.Charts(0).SeriesCollection.Add()
Me.ctlGraph.Charts(0).SeriesCollection(0).SetData _(OWC.ChartDimensionsEnum.chDimValues, 0, "D3:E3")
|
|
|
|
|
Dave,
Thank you so much for your good suggestion. These days, I did a lot of research on .net call com component.
Following their instruction, I ‘m starting to work on vb.net part to call the com component. Like the one of them (http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=55).
The following steps is what I did.
1. I ‘m using VS.net command prompt. Go to the directory where .dll file lives
type: TLBIMP comAuth.dll /out: comAuthMetadata.dll, then I can find comAuthMetadata.dll in the same directory.
2. Use ildasm comAuthMetadata.dll command on VS.net command prompt, I can view the com specific information just like the one mentioned in this article. But I can’t find the method I want to call from vb.net.
Did I do something wrong? Or the problem comes from MFC com? Don’t I have the privilege to access method in com?
Thank you very much in advance for your any suggestion
Jane
|
|
|
|
|
Is the method 'Public' in the com?
Steve
|
|
|
|
|
Steve,
Thank you very much for your immediate reply.
Actually, my colleague who is responsible for com found same problem as me. He try to modify it.
Jane
|
|
|
|
|
How to play WAV file from resource ???
Mihei89
|
|
|
|
|
Hi,
you can try the code below
using System;
using System.Runtime.InteropServices;
using System.Resources;
using System.IO;
namespace Win32
{
public class Winmm
{
public const UInt32 SND_ASYNC = 1;
public const UInt32 SND_MEMORY = 4;
// these 2 overloads we dont need ...
// [DllImport("Winmm.dll")]
// public static extern bool PlaySound(IntPtr rsc, IntPtr hMod, UInt32 dwFlags);
// [DllImport("Winmm.dll")]
// public static extern bool PlaySound(string Sound, IntPtr hMod, UInt32 dwFlags);
// this is the overload we want to play embedded resource...
[DllImport("Winmm.dll")]
public static extern bool PlaySound(byte[] data, IntPtr hMod, UInt32 dwFlags);
public Winmm()
{
}
public static void PlayWavResource(string wav)
{
// get the namespace
string strNameSpace=
System.Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString();
// get the resource into a stream
Stream str =
System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream( strNameSpace +"."+ wav );
if ( str == null )
return;
// bring stream into a byte array
byte[] bStr = new Byte[str.Length];
str.Read(bStr, 0, (int)str.Length);
// play the resource
PlaySound(bStr, IntPtr.Zero, SND_ASYNC | SND_MEMORY);
}
}
}
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::;
To use the class, you can make the call as follows:
private void button2_Click(object sender, System.EventArgs e)
{
Win32.Winmm.PlayWavResource("chimes.wav");
}
|
|
|
|
|
How to use flexgrid in VisualBasic.net
can u help me
thanks in advance
|
|
|
|
|
Why would you want to ? That's what the datagrid is for.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks a lot.
is datagrid is same as Flexgrid in VB
|
|
|
|
|
Hi,
may i know how to disable alt+tab and windows key for my application?
ghost
|
|
|
|
|
If that's possible at all, it requires a system wide keyboard hook. There are articles on CP on how to do this, but I'm not sure if it will work. If not, then it's not possible.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Yes It is possible. You will definitely need a System Wide Hook.
Which version of VB are you using ¿
In VB 6, you will need to use the SystemParametersInfo API. You can implement it like this :
Private Declare Function SystemParametersInfo _
Lib "user32" Alias "SystemParametersInfoA" _
(ByVal uAction As Long, ByVal uParam As Long, _
ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long 'API Function to disable keys
Private Sub DisableCtrlAltDel(bDisabled As Boolean)
' Disables Control Alt Delete Breaking
'as well as Ctrl-Escape
Dim X As Long
X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
End Sub
Then the call to the Above function :
Private Sub Form_Load()
Call DisableCtrlAltDel(True) 'disable the system keys
End Sub
'Remember to Enable the system keys again, when the program exits, otherwise it will remain blocked. To re enable them, Just supply False to the DisableCtrlAltDel function.
With VB.NET it is a bit more difficult. Luckily there is a component called mclhotkey, which will give you the functionality of a System Wide Hook. You can find that component here :
http://www.codeproject.com/useritems/mclhotkey.asp?print=true[^]
Hope that helps!
H T G
|
|
|
|
|
Hi,
Sorry forget to tell you what version i am using. I am using vb.net 2005 to develop a windows form.
|
|
|
|
|
Hi,
I find the solution already.
thx
|
|
|
|
|
"end for" can break a for loop.
but how to continue a for?
for example:
For i =0 to 10<br />
if(i =4)<br />
continue<br />
Response.write(i)<br />
Next
the result should be:
012356789
But how to do it in vb??
-- modified at 5:30 Thursday 17th August, 2006
|
|
|
|
|
That looks like perfectly good VB to me, except that I thought you needed 'then' and continue on the same line, unless you put end for.
Another way would be
if (i<>4) then Response.Write(i)
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
mimimimilaw wrote: "end for" can break a for loop.
Hmm, isn't that Exit For ¿¿
|
|
|
|
|
If you have a textbox named Text1 in your form(VB), then this will do the job
For i=0 To 10
If i=4 then
GoTo ss
End If
Text1.Text=Text1.Text & i
ss:
Next
sujithcjose@yahoo.com
http://www.sujith.cjb.net
|
|
|
|
|
I need to fix an installation problem. I have created a setup programm using MS Windows Installer. My project involves VB6, Crystal Report 9 and SQL server 2000. I have used merged module. Setup is built successfully showing no error. I need to run the setup in user computer using admin previlege. It installs and runs successfully in admin previlege login. But when user(doesn't have admin previlege) logs in the computer and tries to use programm, gets runtime error showing message which says like msdatgrd.ocx or one of its dependencies are not registered correctly. When this user is given admin previlege the software runs nicely. Same thing happens for mscomct2.ocx. I need help in this regard urgently.
|
|
|
|
|
iam doing a project in vb.net (winforms) .I have a timespan variable which has a start time and a frequency.this is saved in the database.the field for time is defined as char(this is a must, i can't use datetime or timestamp for storing a time value)
I have a click event on a button called 'view', where a display form should come in which this start time is shown for 24 hrs, each time the frequency is added to the previous one.
For example if the start time is 06.00 and the frequency is 1 hr, then the display form will show from first 06.00 and then one hour added to it , ie 7.00..like this it is shown for 24 hrs from teh start time.
If the frequency is quarterly then 15 minutes is added to each time starting from the start time.
there is no date associated, only time.
So what should i use for this.
For houlry basis I tried using a timespan variable.but when the adding continues, once it reached 23 hrs then it goes to 1.00:00, 1.01:00, 1.02:00 etc etc..instead of 00:00, 01:00, 02:00 respectively
what should be done.please help.it is very urgent.
thanks
chepps.
Chepps
|
|
|
|
|
Why can't you use a datetime or timestamp?
What is your code for incrementing this value?
Steve
|
|
|
|
|
i have used a timestamp variable only
if temp is that variable
then my code will be
temp = temp.Add(TimeSpan.FromHours(1))
this is in a loop for 24hrs.This is showing correctly till 23:00.
Chepps
|
|
|
|