|
Yeah, this is still a Web Development forum question. It has nothing to to with VB.NET, so I suggest posting this in the correct forum.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi i want to use a editor asif richtextbox in my vb.net application could any one help me
i have to highlight the text wat i want to find
i have to change the colors of some key words automatically like any programming language editors do
pls do early help my project is hanging
with regards
Balagurunathan.B
|
|
|
|
|
I have a SSTab component on my form. I want to change the color of it to white with black font on it.
If I change the 'BackColor' to 'White', the back screen changes but not the color of the tabs.
Can anyone please tell me how do I change the color of the tabs on the SSTab component?
|
|
|
|
|
Hi,
You can try:
tabcontrol.TabPages(0).BackColor = somecolor
My advice is free, and you may get what you paid for.
|
|
|
|
|
hi guys i need help again =)
i am currently trying to make a form in a form
i a sure u guys seem microsoft access subform where by the subform is actually another form in the access and the user can navigate the form by those scroll bar even if the window of the form is small
i am trying to do that in vb.net! issit possible? if it is could anyone tell me which control/component to use and how to use it thx
well i mean like i make 2 form ( from1 and form2)
how ever i would like to make a form viewer within form1 to view from 2
meaning: i would be able to view form2 thru a box(form viewer) while being in form1
wat i wanna know is that possible and if it is how? as i dont know if vb.net have such thing as form viewer >.< pls help!
ps:this is a repost as i post in the wrong topic >.<
|
|
|
|
|
What you are asking for is called MDI. So, now you can search for it.
---
single minded; short sighted; long gone;
|
|
|
|
|
as u might be knowing now that this is MDI(Multipple document interface).
u can make this in the way given below..
first of all make a parent form by selecting iscontainer property as true..
nw add tree view or pic box, whichever you want...
make a click event in parent form and add a new form2.
and under the click event write this coding...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim NewMDIChild As New Form2()
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
end sub()
and change the window sate of both form1 and form 2 as maximum if u want..
thats it..
form2 is MDI child now,
if u have any doubt regarding MDI post yr problem..
bye
bye...
|
|
|
|
|
Perhaps you should answer the original poster instead of me.
Tip: It would be easier to read what you write if you stick to the standard style of writing instead of inventing your own. The start of a sentence is signified by making the first letter in the word capital, not by putting it on a new line. A sentence is ended by a singe period, not two or three.
---
single minded; short sighted; long gone;
|
|
|
|
|
There's another way to do this without using MDI. You can find an example in this[^] MSDN article, or if MSDN is responding, like it is now, you can search for it later by Googling for "Five Tricks for your Visual Basic .NET bag".
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have hierarchical data that the user can make one of four choices about. The primary treeview manages @900 rows of data that collapsed to @100 groups.
I need to draw a tree view with a 'radio button group' where the radio buttons are related to the treeview node index.
I have made a User Control for the 4 radio button but can't quite figure out:
1) How to Position the radiobuttonControl to align with the tree view node
2) Linkage to connect the option group data to the index appropriate treeview node
i.e.
[a,b,c,d] tvNode1
[a,b,c,d] tvNode2
Each control is located on separate panels, panel 1 is for the radio buttons, panel 2 is for the Treeview. - Is there may be a better way???
TIA
Tom Hamilton
Sacramento, CA
|
|
|
|
|
I am trying to create a program that allows users to create new folders and set security permissions. Any help would be greatly appreciated. VBV.NET/ NET Framework 2.0
|
|
|
|
|
If you Import System.IO
You will have access to the Directory object.
You can do a Directory.CreateDirectory(path, directorySecurity)
where path is your new folder
and directorySecurity is the directory security for the folder.
Here some sample code from Microsoft help on directorysecurity:
Imports System
Imports System.IO
Imports System.Security.AccessControl
Module DirectoryExample
Sub Main()
Try
Dim DirectoryName As String = "TestDirectory"
Console.WriteLine("Adding access control entry for " + DirectoryName)
' Add the access control entry to the directory.
AddDirectorySecurity(DirectoryName, "MYDOMAIN\MyAccount", FileSystemRights.ReadData, AccessControlType.Allow)
Console.WriteLine("Removing access control entry from " + DirectoryName)
' Remove the access control entry from the directory.
RemoveDirectorySecurity(DirectoryName, "MYDOMAIN\MyAccount", FileSystemRights.ReadData, AccessControlType.Allow)
Console.WriteLine("Done.")
Catch e As Exception
Console.WriteLine(e)
End Try
Console.ReadLine()
End Sub
' Adds an ACL entry on the specified directory for the specified account.
Sub AddDirectorySecurity(ByVal FileName As String, ByVal Account As String, ByVal Rights As FileSystemRights, ByVal ControlType As AccessControlType)
' Create a new DirectoryInfoobject.
Dim dInfo As New DirectoryInfo(FileName)
' Get a DirectorySecurity object that represents the
' current security settings.
Dim dSecurity As DirectorySecurity = dInfo.GetAccessControl()
' Add the FileSystemAccessRule to the security settings.
dSecurity.AddAccessRule(New FileSystemAccessRule(Account, Rights, ControlType))
' Set the new access settings.
dInfo.SetAccessControl(dSecurity)
Hope that helps.
Ben
|
|
|
|
|
I am new to VB.Net 2005, is there anyone who can help, I am trying to send text message to a wireless pager from my work PC. My SMTP server will not allow this due to NetworkCredential. Here is the code i am using that just will not work.
mail.From = New MailAddress("email address@my.company")
mail.To.Add("email address@my.company")
Dim mailClient As New SmtpClient
Dim basicAuthenticationInfo As New System.Net.NetworkCredential("network login Name", "network password", "name of my smtp server")
mail.To.Add("mypager#@usamobility.net")
mailClient.Host = "my.server"
mailClient.UseDefaultCredentials = False
mailClient.Credentials = basicAuthenticationInfo
mailClient.Send(mail)
|
|
|
|
|
|
Is it possible to launch an exisitng MS access database (Test.mdb) from my VB6?
Sub OPEN_ACCESS()
Dim oApp As Object
Dim OPEN_ACCESS
OPEN_ACCESS = "T:\ACCESS\TEST.mdb"
Set oApp = CreateObject("ACCESS.Application")
oApp.Database.Open (OPEN_ACCESS)
oApp.Visible = True
End Sub
|
|
|
|
|
I'm developing a project on Visual Studio 2005 and I need to publush it on a web page. I'm using this HTML code:
<object
id="eDataMan"
name="eDataMan"
classid="http:eDataMan.dll#eDataMan.eDataMan"
style="width:100%; height:100%; background-color:ButtonFace; font-family:Arial; font-size:x-
small">
</object>
But all I get is a picture icon on the web page, the program does not run.
I'm using Component One True DBGrid control on my project
This is what I have on my VB.NET project:
Modulo objsafe.vb:
-----------------------------------------------------
Imports System.Runtime.InteropServices
Module objsafe
<ComImport()> _
<Guid("CB5BDC81-93C1-11CF-8F20-00805F2CD064")> _
<InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
Public Interface IObjectSafety
Function GetInterfaceSafetyOptions(ByRef iid As Guid, ByRef pdwSupportedOptions As Integer, ByRef pdwEnabledOptions As Integer) As Integer
Function SetInterfaceSafetyOptions(ByRef iid As Guid, ByVal dwOptionSetMask As Integer, ByVal dwEnabledOptions As Integer) As Integer
End Interface
End Module
-----------------------------------------------------
Control eDataMan.vb:
-----------------------------------------------------
Public Class eDataMan
'Inherits Windows.Forms.UserControl
Implements IObjectSafety
' Constants for implementation of the IObjectSafety interface
Private Const INTERFACESAFE_FOR_UNTRUSTED_CALLER As Integer = &H1
Private Const INTERFACESAFE_FOR_UNTRUSTED_DATA As Integer = &H2
Public Function GetInterfaceSafetyOptions(ByRef iid As Guid, ByRef pdwSupportedOptions As Integer, ByRef pdwEnabledOptions As Integer) As Integer Implements IObjectSafety.GetInterfaceSafetyOptions
pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER Or INTERFACESAFE_FOR_UNTRUSTED_DATA
pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER Or INTERFACESAFE_FOR_UNTRUSTED_DATA
Return 0
End Function
Public Function SetInterfaceSafetyOptions(ByRef iid As Guid, ByVal dwOptionSetMask As Integer, ByVal dwEnabledOptions As Integer) As Integer Implements IObjectSafety.SetInterfaceSafetyOptions
Return 0
End Function
Private Sub eDataMan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO CODE
MsgBox("I'm here")
End Sub
End Class
-----------------------------------------------------
-- modified at 12:02 Thursday 8th March, 2007
|
|
|
|
|
Private Sub CheckZeroRecord()
With clsEmpDependant
If ZeroRecord(cTbl_EmpDependatHead, Cnn) = False Then
If .MoveRecord(Employee_Module.GotoRecord.PreviousRecord, HelpBoxEmployeeName.get_HelpCode() & txtDocumentNo.Text) = True Then DisplayRecord() : GoTo procExit
If .MoveRecord(Employee_Module.GotoRecord.NextRecord, HelpBoxEmployeeName.get_HelpCode() & txtDocumentNo.Text) = True Then DisplayRecord() : GoTo procExit
If .MoveRecord(Employee_Module.GotoRecord.FirstRecord, "") = True Then DisplayRecord() : GoTo procExit
End If
NavigationBar.AddNewRecord()
AddRecord()
End With
procExit:
End Sub
----------------------------------------------------------------------------------------------------
I wrote the above code in Visual Basic.Now I upgraded it to Visual Basic.Net but it gives this Error Message:(Statement cannot appear within method body.End of method assumed).It will now underline Private Sub.
please help me out.
Thanks.Ademola
-- modified at 10:08 Thursday 8th March, 2007
|
|
|
|
|
This is because you tried to do something like this:
Private Sub Method1()
.
.
.
Private Sub Method2()
.
.
.
End Sub
.
.
.
End Sub
You tried to define a method inside another method. Obviously, you can't do that.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi i have to do a application i have to find a text given as input in the richtextbox
but i am not able to do that as its not points the cursor to the point where the text has to be find is there
with regards
Balagurunathan.B
|
|
|
|
|
balakpn wrote: but i am not able to do that as its not points the cursor to the point where the text has to be find is there
That's because you have to write the code that highlights the found text. It doesn't happen automatically.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i am not able to find that will u help me
with regards
Balagurunathan.B
|
|
|
|
|
What do you mean "not able to find that"? Of course you can't find it, you haven't written it yet!
Start with the Find() method of the RichTextBox. It'll return the text position of the first occurance of whatever you want to find. You the use that value to set the RTB's SelectionStart property and the length of your serarch term to set the SelectionLength property to highlight the text. Then call the RTB's ScrollToCaret method to make sure that the user can see the highlight.
The rest is left up to you as an exercise.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
in my application i am using database connection where ever i am opening the connection i have used con.close to close the connection but its not getting closed
with regards
Balagurunathan.B
|
|
|
|
|
.NET uses connection pooling. The connection will stay open in the background and when you create a new connection you'll get the previous (pooled) connection. This saves a lot of time because creating the initial connection can be time consuming.
|
|
|
|
|
so if i want to close it means wat i have to do
why i am asking is then only i can continue the next process
it is must for my project
with regards
Balagurunathan.B
|
|
|
|