|
you have used three arguments, wilde that's the error. You can use only two arguments according to this format
AxMSFlexGrid1.set_ColWidth(coloumn Number,width)
example
AxMSFlexGrid1.set_ColWidth(1,3000)
Regards,
Chatura Dilan
If at first you don't succeed, try; try again, so that you know
what not to do the next time. The answer is out there.
|
|
|
|
|
thanks chatura! i tried this format but it still didnt work......
AxMSFlexGrid1.set_ColWidth(coloumn Number,width)
example
AxMSFlexGrid1.set_ColWidth(1,3000)
but i tried this one it works ....
AxMSFlexGrid1.set_ColWidth(1, ,3000)
|
|
|
|
|
I am new to the vb.net thing and am trying to self teach myself so any help is appreciated.
I need to be able to make sure that a textbox entry is only numbers and that I can backspace it to remove a bad entry.
I think its probably something like a bunch of ASCII characters to reference and valadate the entry but I am not sure.
Sub Text_KeyPress(KeyAscii As Integer)
If uiEnterInterNumTextBox.Text = KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0
and uiEnterInterNumTextBox.Text = KeyAscii
End Sub
|
|
|
|
|
heres how I would do it. remember, in vb, try not to do it the hard way. most of the time you'll find an easy one.
BTW somthing seems wrong with your keypress event handler, I'm used to
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
now if your working in vb 6 or VBA this code may not work.
by the way if this is homework, at least paraphrase... geta little edu for your money.
Sub Text_KeyPress(KeyAscii As Integer)
If isAllNumbers(uiEnterInterNumTextBox.Text)Then
KeyAscii = 0
uiEnterInterNumTextBox.Text = KeyAscii
End If
End Sub
Private Function isAllNumbers(ByVal teststring As String) As Boolean
Dim isgood As Boolean = True
For Each c As Char In teststring
If Not Char.IsDigit(c) and not(c = ".") and not( c = ",") Then
isgood = False
Exit For
End If
Next
Return isgood
End Function
hey...slang is the vernacular for the vernacular...wow
|
|
|
|
|
Or
You can use a MaskedTestbox to do it
Or
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress<br />
If (AscW(e.KeyChar) < 48 Or AscW(e.KeyChar) > 57) Then<br />
e.KeyChar = Nothing<br />
End If<br />
End Sub
Regards,
Chatura Dilan
If at first you don't succeed, try; try again, so that you know
what not to do the next time. The answer is out there.
-- modified at 23:25 Tuesday 4th April, 2006
'sorry.. when you use e.KeyChar = Chr(Keys.Back), other keys always do backspace's job. I corrected it. It must be e.KeyChar = Nothing
|
|
|
|
|
see...easy answers
hey...slang is the vernacular for the vernacular...wow
|
|
|
|
|
This is the code:
Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReset.Click
TextBox1 = Nothing
TextBox2 = Nothing
TextBox3 = Nothing
TextBox5 = Nothing
TextBox6 = Nothing
DateOfbirth = Now
TextBox7 = Nothing
TextBox8 = Nothing
TextBox9 = Nothing
TextBox10 = Nothing
TextBox11 = Nothing
Department = "Administration"
personal = New Personal
when i click the rest button nothing happens. when i use Form.reset() it doesnt change anything either. Can someone please help?
-- modified at 20:16 Tuesday 4th April, 2006
|
|
|
|
|
That is because you are not doing anything at all to the controls. The TextBox1 variable is not a textbox, it's only a reference to the textbox. When you set the variable to Nothing, you are only throwing away your reference to the control. That doesnt affect the control the least bit, it couldn't care less whether you have a reference to it or not.
If you want to change the contents of the control, set the Text property of the control.
---
b { font-weight: normal; }
|
|
|
|
|
Thankyou heaps i have got it to work now. your a great help.
just one more thing, im trying to get my application to send an email to the user if they forget their password, the code is:
If My.User Is Authenticated Then
txtUser.Text = My.User.Name
If userExists(My.User.Name) Then
txtPassword.Focus()
Else : NewUser = True
MessageBox.Show("You are new to the system, please select request account and enter your details", "User Information")
End If
Else if
MessageBox.Show("Sorry you are not authenticated to use this program" & vbNewLine & "If you are a staff member please select help or contact us")
End If
im not sure how to declair Authenticated,userExists and new user. With userExists i need to get it to check the database where all the users are stored yes? but im not to sure how to do this
|
|
|
|
|
on the topic of email, this is how I do it for VB forms. it also works when exposed through a web service.
Imports system.net.Mail
public class mailer
Private email As MailMessage
Private webmailer As System.Net.Mail.SmtpClient
Private Sub sendMail()
email = New MailMessage("Sender Email", "Reciepient Email", "Subject Text", _
"Body Text")
webmailer = New System.Net.Mail.SmtpClient("SMTP Server Name as String", _
"SMTP service port: usually 25")
With email
.Attachments(0) = New Attachment("c:\SomeFile.txt")
.Attachments(1) = New Attachment("c:\SomeOtherFile.txt")
End With
webmailer.Send(email)
End Sub
end class
server admin has a big impact on whether this will work. if it fails it may not be the code, but the smtp server configuration.
good luck
hey...slang is the vernacular for the vernacular...wow
-- modified at 21:35 Tuesday 4th April, 2006
|
|
|
|
|
Make sure you are setting the .Text property to "" or String.Empty. You are attemting to set the Controls (TextBox1, TextBox2, etc.) to Nothing.
Example
TextBox1.Text = String.Empty
This also works
TextBox1.Clear
Hope this helps
"Some people spend an entire lifetime wondering if they made a difference. The Marines don't have that problem."
( President Ronald Reagan)
|
|
|
|
|
this is A weird way to use a service, I know, but I'd like to query/modify a property within a running windows service, from an interactive VB app.
I've crafted a service with a public property that return an object,
and I'd like to query the value of that object from another application.
Does any one know of a way to hook to the running service (call it by name or whatever) so I can call the property?
hey...slang is the vernacular FOR the vernacular...wow
|
|
|
|
|
Hello all, I received a .csv file containing the HTML code generated from running a web-based report. I need to parse the file to get rid of all the HTML, leaving only the viewable text. I would like to just run a macro to perform this but if someone knows another way, say in VB.Net, that will be fine also. Unfortunately I cannot attach the file due to the sensative nature of the data. Thanks in advance for any help provided.
Mark Oium
Mark Oium
|
|
|
|
|
simple answer:
copy the .csv to a backup file
open the copy in word and find/Replace "," with " ".
then rename the file extension to .html
then open it with your favorite browser.
if the information displays as desired,
copy out the desired text (cntrl + a or Shift + End help a lot)
and paste it into another word or text document.
that should work...
as for an script or applet, that would take some time and trouble.
depending on the html, it would probably be quite dificult to define all the things you need to strip out. probably longer than editing it cy hand...
hey...slang is the vernacular for the vernacular...wow
|
|
|
|
|
How to you a command button to select a picture to add it to a database.
|
|
|
|
|
the answer is multipart.
1) use a fileBrowseDialog to browse to teh pic. u can find samples all over.
2) open a filestream to the file and read it into a bytearray (or whatever is compatile with your dataset schema). reading a pic is the same as reading a text file if you stay at the bin/hex level. it's just a datastream...treat it like one.
3) add the bytearray to your dataset, and update.
hey...slang is the vernacular for the vernacular...wow
|
|
|
|
|
I'm running VB6.0.
I have a form that I need to be able to Maximize and Minimize, but I also have a Form.Resize procedure.
During runtime, when I click the Minimize or Maximize button, I get an error (non-fatal) that says "A form can't be moved or sized while minimized or maximized". It's obviously trying to run my Form.Resize procedure.
When I click Maximize, I want it to run the Form.Resize function because I do not want the form at its maximum width (full screen).
When I click Minimize, I want it to be in the toolbar only, with no error.
Here are the questions:
1. Is there a way to create a MaxWidth for the form, so when I click Maximize, it only goes to that width.
2. Is there a way to NOT run my Form.Resize when Minimize or Maximize is pressed or have it run without giving me the error?
Thank you.
|
|
|
|
|
hi, how i can deployment to project has crystal report .
i install frmwork but my crystal report not run and display error message :: file or assembly name crystaldecions.windows.forms , or one of its dependencies ,was not found.
123
|
|
|
|
|
did you create a .net setup project?
if not, do so. you'll love it. many online tutorials available.
if you have, look into merge modules.
Good luck
hey...slang is the vernacular for the vernacular...wow
|
|
|
|
|
I have signed up to a free web hosting site, but it doesn't support code behind. Is there any way around this, becuase it will accept my webform1.aspx file, but not my webform1.aspx.vb file.
|
|
|
|
|
|
When you publish the web site there is no reason to publish the code behind files, as all the code in the code behind files are compiled into the dll files. You only need to publish the aspx pages and the dll files in the bin folder (and other files that you use, like css files and images).
---
b { font-weight: normal; }
|
|
|
|
|
1. can any body tell me how can i create a RunTime(Dynamic) Menu just exactly like www.Agentimage.com have in VB.Net.
2.How can i connect MySql with ASP.Net. i tried but failed.
Aavesh
|
|
|
|
|
Hi All,
While I run the application I got bellow error
The application failed to initialize properly(0x0000005). Click on OK to terminate the application
please suggest me..
Thanks
sonj
|
|
|
|
|
In the short term my suggestion would be to click on the OK button.
In the medium term perhaps posting a code snippet or giving us as much details as you can may help in diagnosing the underlying cause of the problem.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|